Reputation: 5997
Consider the following example. When Binding a event listener to a event type can just fulfill the output, what is the significance of binding multiple event listeners to same even?
readStream.on("data", function(data) {console.log('I have some data here.');
});
readStream.on("data", function(data) {console.log('I have some data here too.');
});
Upvotes: 1
Views: 607
Reputation: 36339
Mostly it's for modularity. You wouldn't likely do that in the same file, unless you're defining your listener functions somewhere else and then composing them in one place.
Upvotes: 2