Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support on/off events #461

Merged
merged 2 commits into from Nov 12, 2014
Merged

Support on/off events #461

merged 2 commits into from Nov 12, 2014

Conversation

@raimohanska
Copy link
Contributor

raimohanska commented Nov 7, 2014

Some libs (for example, codemirror) publish events using on/off methods instead of addListener/addEventListener/bind. It's easy to add support for those in Bacon.fromEventTarget.

Shall we?

@wolfflow
Copy link
Member

wolfflow commented Nov 7, 2014

Thumbs up! I would purge .on/.off mess from my marionettejs code, replacing it with new handlers)

sub = target.addEventListener ? (target.addListener ? target.bind)
unsub = target.removeEventListener ? (target.removeListener ? target.unbind)
sub = target.addEventListener ? target.addListener ? target.bind ? target.on
unsub = target.removeEventListener ? target.removeListener ? target.unbind ? target.off ? target.off

This comment has been minimized.

Copy link
@rpominov

rpominov Nov 7, 2014

double target.off %)

This comment has been minimized.

Copy link
@raimohanska

raimohanska Nov 7, 2014

Author Contributor

Oh, nicely spotted. Clearly a vim error :) Fixed in 94fb7e7

@raimohanska raimohanska force-pushed the feature/on-off branch from 94fb7e7 to 9d622bc Nov 12, 2014
@raimohanska raimohanska merged commit 9d622bc into master Nov 12, 2014
1 check was pending
1 check was pending
continuous-integration/travis-ci The Travis CI build is in progress
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.