Created
February 3, 2016 04:48
-
-
Save khle/c410c04069e14a2f8a5a 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
| import {Observable} from 'rx'; | |
| export function textEntryIntentWithSendButtonClicked(DOMSource) { | |
| const textStream$ = DOMSource.select('#input-msg').events('keyup').map(e => e.target); | |
| const buttonClick$ = DOMSource.select('#send-btn').events('click').map(e => e.target); | |
| return {textStream$, buttonClick$}; | |
| } | |
| export function textEntryIntentWithEnterKeyPressed(DOMSource) { | |
| const textStream$ = DOMSource.select('#input-msg').events('keyup').filter(textStream => textStream.keyCode !== 13).map(e => e.target); | |
| const enterKeyPressed$ = DOMSource.select('#input-msg').events('keyup').filter(textStream => textStream.keyCode === 13).map(e => e.target); | |
| return {textStream$, enterKeyPressed$}; | |
| } | |
| ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment