views/messages.js
function (core, channel, opts) {
        opts = opts || {}

        var t = through.obj()

        if (opts.gt) opts.gt = 'msg!' + channel + '!' + charwise.encode(opts.gt)  + '!'
        else opts.gt = 'msg!' + channel + '!'
        if (opts.lt) opts.lt = 'msg!' + channel + '!' + charwise.encode(opts.lt)  + '~'
        else opts.lt = 'msg!' + channel + '~'

        this.ready(function () {
          var v = lvl.createValueStream(xtend({reverse: true}, opts))
          v.pipe(t)
        })

        return readonly(t)
      }
function (core, channel, opts) {
        opts = opts || {}

        var t = through.obj()

        if (opts.gt) opts.gt = 'msg!' + channel + '!' + charwise.encode(opts.gt)  + '!'
        else opts.gt = 'msg!' + channel + '!'
        if (opts.lt) opts.lt = 'msg!' + channel + '!' + charwise.encode(opts.lt)  + '~'
        else opts.lt = 'msg!' + channel + '~'

        this.ready(function () {
          var v = lvl.createValueStream(xtend({reverse: true}, opts))
          v.pipe(t)
        })

        return readonly(t)
      }
function ( core , channel , opts ) { opts = opts || { } var t = through . obj ( ) if ( opts . gt ) opts . gt = 'msg!' + channel + '!' + charwise . encode ( opts . gt ) + '!' else opts . gt = 'msg!' + channel + '!' if ( opts . lt ) opts . lt = 'msg!' + channel + '!' + charwise . encode ( opts . lt ) + '~' else opts . lt = 'msg!' + channel + '~' this . ready ( function ( ) { var v = lvl . createValueStream ( xtend ( { reverse : true } , opts ) ) v . pipe ( t ) } ) return readonly ( t ) }
Creates a read stream of messages
@param {Object} core - HyperCore to stream messages from.
@param {String} channel - Name of channel
@param {Object} opts :
`gt` {Number} - Filter by timestamp where message.timestamp is greater than `gt`
`lt` {Number} - Filter by timestamp where message.timestamp is lesser than `lt`
Supports all levelup.createValueStream() options as well:
`reverse` {Boolean} - Streams messages in Ascending time order, default: `true` (Descending)
Creates a read stream of messages