Skip to content

Instantly share code, notes, and snippets.

@queckezz
Created July 14, 2015 12:17
Show Gist options
  • Save queckezz/49e67158a8f6bd089455 to your computer and use it in GitHub Desktop.
Save queckezz/49e67158a8f6bd089455 to your computer and use it in GitHub Desktop.
remap flyd functions to more convenient api
const {
reject,
identical,
keys,
pick,
mapObjIndexed
} = require('ramda')
const flyd = require('flyd')
const Stream = flyd.stream
const filterConstructor = reject(identical('stream'))
const addTo = (obj) => {
return (value, key) => {
obj[key] = value
}
}
mapObjIndexed(addTo(Stream), pick(filterConstructor(keys(flyd)), flyd))
module.exports = Stream
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment