Created
June 3, 2018 09:53
-
-
Save jamestthompson3/d5a2aa074f22a92cccd30c74295375c7 to your computer and use it in GitHub Desktop.
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
const textHandler = mapPropsStream(props$ => { | |
const { stream: onInput$, handler: handleChange } = createEventHandler() | |
const text$ = onInput$.pipe(map(e => e.target.value), startWith('')) | |
return props$.pipe( | |
switchMap(props => text$.pipe(map(text => ({ ...props, text, handleChange })))) | |
) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment