Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add flatMapFirst and debounceImmediate #132

Closed
raimohanska opened this Issue Mar 27, 2013 · 5 comments

Comments

Projects
None yet
2 participants
Contributor

raimohanska commented Mar 27, 2013

As discussed in #82, it might make sense to support for debounceImmediate, that fires the event on the leading edge of the wait interval instead of the trailing edge. As with _.debounce(x, true):

http://underscorejs.org/#debounce

There's a tentative implementation in the flatMapFirst branch. As the branch name suggests, there's also a new method called flatMapFirst, which is a variation of flatMap that only spawns a single streams at a time, ignoring input events until the spawned stream ends. The debounceImmediate method is obviously based on flatMapFirst.

Contributor

raimohanska commented Mar 28, 2013

Any thoughts? Should we have debounceImmediate(delay) or debounce(delay, immediate=false)?

Member

wolfflow commented Mar 29, 2013

First one kinda better, IMHO )

Member

wolfflow commented May 25, 2013

This feat is extremely useful, and one lil' question – when it would be merged into master ?

In my use case I need to accept an kb event, and block any of them while animation is being played (simple carousel).

At this moment I use the monkey-patch =)

Contributor

raimohanska commented May 28, 2013

In master it is.

Member

wolfflow commented May 28, 2013

Thank ye) really good!

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