collect-mutations

1.0.6 • Public • Published

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

Package Sidebar

Install

npm i collect-mutations

Weekly Downloads

3

Version

1.0.6

License

ISC

Unpacked Size

6.23 kB

Total Files

4

Last publish

Collaborators

  • regular