mfr-query-stream

2.0.1 • Public • Published

mfr-query-stream

create a scroller for map-filter-reduce query.

Assumes that there is a timestamp property which the query is sorted by.

example

var QueryStream = require('mfr-query-stream')
var pull = require('pull-stream')
 
return QueryStream(
 
  api.sbot.query.read, //function to query the database
 
  [{$filter: {value: { //the query. here we filter for messages with type: post that are not private.
    private: {$is: 'undefined'},
    content: {type: 'post'},
    author: id //by a given author.
  }}}],
 
  //a pull stream that takes messages and outputs html elements.
  pull.map(api.message.layout),
 
  //a container element to put all the items into.
  h('div.content')
)

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i mfr-query-stream

Weekly Downloads

1

Version

2.0.1

License

MIT

Unpacked Size

3.24 kB

Total Files

5

Last publish

Collaborators

  • dominictarr