Skip to content

Instantly share code, notes, and snippets.

@griffinmichl
Created May 21, 2016 03:00
Show Gist options
  • Select an option

  • Save griffinmichl/61036b272003b7a6c94bed8611dddd40 to your computer and use it in GitHub Desktop.

Select an option

Save griffinmichl/61036b272003b7a6c94bed8611dddd40 to your computer and use it in GitHub Desktop.
function isChar(key) {
return characters.includes(key);
}
function isSpace(key) {
return key === 'space'
}
const keyup$ = Observable.fromEvent(promptInput, 'keyup')
.map(keycode)
const char$ = keyup$.filter(isChar)
const space$ = keyup$.filter(isSpace)
export const word$ = char$
.buffer(() => space$)
.map(listOfChar => listOfChar.join(''))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment