Created
June 3, 2018 09:53
-
-
Save jamestthompson3/eaee05da2e762e50a46418ed65af85ab 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