Skip to content

Instantly share code, notes, and snippets.

@kaosat-dev
Created February 23, 2017 12:58
Show Gist options
  • Save kaosat-dev/5d99189ffbbc8a120fd93496c75bf526 to your computer and use it in GitHub Desktop.
Save kaosat-dev/5d99189ffbbc8a120fd93496c75bf526 to your computer and use it in GitHub Desktop.
Variable periodic (most.js)
settingsState$
.flatMap(function (pollRate) { // refresh data list every x ms
console.log('pollRate changed, do it every',pollRate)
const id = Math.floor(Math.random()*100,1)
return constant(id, periodic(pollRate))
})
.forEach(x=>console.log('combined state stuff',x))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment