On each #18

Merged
merged 1 commit into from Jan 19, 2013

Conversation

Projects
None yet
2 participants
Contributor

Raynos commented Jan 18, 2013

As mentioned in #15

Owner

dominictarr commented Jan 18, 2013

I hate to be that guy but a fresh pull request means a fresh branch off master, with only the changes discussed in it - not just the github form.
so that this can be merged cleanly...

Contributor

Raynos commented Jan 18, 2013

So you want me to rebase away the noise?

Contributor

Raynos commented Jan 19, 2013

@dominictarr rebased!

Implement onEach
Set#onEach will call the callback with all rows and any new row
that comes into existance
}
this.setMaxListeners(Infinity)
}
+Set.prototype.onEach = function (callback) {
+ this.forEach(callback)
@dominictarr

dominictarr Jan 19, 2013

Owner

this isn't a callback! a callback is called exactly once, and always has (err, ....)
this variable is should be called iterator or listener, since onEach does both iteration and listening, so i'd accept either.

Of course, this function is only 3 lines long, but as a matter of principle...

naming things well is actually important.

@Raynos

Raynos Jan 19, 2013

Contributor

Agreed. It's not a callback.

@dominictarr dominictarr merged commit 8bea4e9 into dominictarr:master Jan 19, 2013

Owner

dominictarr commented Jan 19, 2013

merged into 3.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment