-
Notifications
You must be signed in to change notification settings - Fork 330
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
Successor for Bacon.fromBinder #704
Comments
Ehm isn't that pull request about Bacon.fromEvent(window, 'scroll', { passive: true }, event => event.prop) I mean about |
Ysh |
Oops sorry |
Yeah there was this suggestion in the comments |
Given the symmetry of bind/unbind calls, how about something like this to avoid duplication: Bacon.fromEventBinder(
window,
(binder, listener) => binder('scroll', listener, {passive: true}),
() => window.scrollX
); The second parameter is called with Edit: This could just be an alternative way of calling
The key is the 2nd parameter. If it's a string, So Bacon.fromEvent(window, 'scroll') is equivalent to Bacon.fromEventBinder(window, (binder, listener) => binder('scroll', listener)); (and |
Agreed. There will always be use cases for |
I'll create a new PR shortly for the following: Bacon.fromEvent(
target: EventTarget|EventEmitter,
eventSource: string|Function,
eventTransformer?: Function
) It will be an alternative to #703. |
See #710 and related documentation |
Might as well close this now that #710 is merged. |
In #703 it was suggested that this version of
Bacon.fromEvent
should be added:It has the virtue of being more readable than
Bacon.fromBinder
. From my point of view, it also looks like it should be returning aProperty
because the third function argument is used to get a current value. The initial value of theProperty
could be set at the time of creation by calling the third function.The text was updated successfully, but these errors were encountered: