Created
January 26, 2015 14:06
-
-
Save roman01la/40a7e873a8085f8ebabe to your computer and use it in GitHub Desktop.
Mixin for handling DOM events via React assignment style using Most
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import most from 'most'; | |
let ReactDOMMostify = { | |
mostifyEventHandler (name) { | |
let emitEvent, stream; | |
emitEvent = () => undefined; | |
this[name] = event => emitEvent(event); | |
stream = most.create(add => emitEvent = add); | |
stream.drain(); | |
return stream; | |
} | |
}; | |
export default ReactDOMMostify; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment