https://github.com/regular/collect-mutations
https://github.com/regular/collect-mutations
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/regular/collect-mutations
- Owner: regular
- Created: 2018-10-09T10:48:13.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-04T04:05:14.000Z (about 7 years ago)
- Last Synced: 2024-04-27T00:24:30.220Z (about 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 22.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
collect-mutations
---
A pull-stream sink for mutation streams coming from [ssb-review-level](https://www.npmjs.com/package/ssb-review-level)
If you want to display a set of ssb messages and want them to update in realtime, this is your friend.
``` js
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:
- [ssb-revisions](https://www.npmjs.com/package/ssb-revisions)
- [mutant](https://www.npmjs.com/package/mutant)
- [tre-watch-heads](https://www.npmjs.com/package/tre-watch-heads)
License: ISC