collect-mutations

Sink ssb-review streams into mutant arrays

collect-mutations

A pull-stream sink for mutation streams coming from ssb-review-level

If you want to display a set of ssb messages and want them to update in realtime, this is your friend.

const collectMutations = require('collect-mutations')
const MutantArray = require('mutant/array')
const mmap = require('mutant/map')

const messages = MutantArray()

pull(
  ssb.revisions.messagesByType('post'),
  collectMutations(messages, err  => console.error(err))
)

document.body.appendChild(
  h('ul', mmap(messages, kv => h('li', kv.value.content.text)))
)

See Also:

License: ISC

HomePage

https://github.com/regular/collect-mutations#readme

Repository

git+https://github.com/regular/collect-mutations.git


上一篇:custom-guider
下一篇:now-app-cli

公众号

欢迎 JavaScript 爱好者