How to properly add and use D3 Events?

This question is similar to the one you posted in the d3-js Google Group. Without duplicating what I wrote there, I would reiterate that you probably don’t want d3.dispatch; that is intended for custom event abstractions (such as brushes and behaviors). It’ll be simpler to use native events. If you want your legend to change … Read more

Vue event modifiers prevent vs. stop

.prevent or event.preventDefault() – It stops the browsers default behaviour (A example is reload when you hit <button type=”submit”> in <form>) .stop or event.stopPropagation() – It prevents the event from propagating (or “bubbling up”) the DOM .once – The event will be triggered at most once

How do I capture a “response end” event in node.js+express?

Strangely enough, it appears that the response emits a “finish” event when the response is closed: https://web.archive.org/web/20120825112648/http://sambro.is-super-awesome.com/2011/06/27/listening-for-end-of-response-with-nodeexpress-js/ Despite this blog entry being a bit old, this event still exists (Line 836 in lib/http.js), so I assume it won’t disappear soon, even though neither node’s nor express’ documentation mention it. By early 2014 it has moved … Read more

Event each time component becomes visible

What I finally did (which is not very beautiful but works while I don’t have a better way to do it…) is to use the ngAfterContentChecked() callback and handle the change myself. @ViewChild(‘map’) m; private isVisible: boolean = false; ngAfterContentChecked(): void { if (this.isVisible == false && this.m.nativeElement.offsetParent != null) { console.log(‘isVisible switched from false … Read more

Relation between command handlers, aggregates, the repository and the event store in CQRS

The following is based on my own experience and my experiments with various frameworks like Lokad.CQRS, NCQRS, etc. I’m sure there are multiple ways to handle this. I’ll post what makes most sense to me. 1. Aggregate Creation: Every time a command handler needs an aggregate, it uses a repository. The repository retrieves the respective … Read more

Angular 2 – List of events

The default handled events should be mapped from the original HTML DOM component’s events: http://www.w3schools.com/jsref/dom_obj_event.asp by just removing the on prefix. onclick —> (click) onkeypress —> (keypress) etc… You can also create your custom events. However ngInit is not an HTML event, this is part of the Angular’s Component lifecycle, and in Angular 2 they … Read more

IObservable vs Plain Events or Why Should I use IObservable?

Observable is the cornerstone of the Rx library. They provide pretty much all the implementations and operators you’ll need. The idea behind IObservable<T> and Rx is not just the “handling” of events, but enabling “LINQ to Events.” So you can easily compose “event streams,” which gives you a lot of power compared to regular event … Read more

tech