git ssb

0+

Dominic / ssb-feed



Commit b05fea73827c1594cc91f3825ed034f8be6f91bc

allow to be put into remote mode

Dominic Tarr committed on 7/26/2016, 4:24:08 AM
Parent: 1a5237c6cc7957a4a1e69cd21fe4cf5d16c4237e

Files changed

index.jschanged
index.jsView
@@ -15,17 +15,20 @@
1515 && !Array.isArray(o)
1616 )
1717 }
1818
19-module.exports = function (ssb, keys) {
20-
19+module.exports = function (ssb, keys, opts) {
20+ opts = opts || {}
2121 if(!ssb.add)
22- throw new Error('*must* install feeds on this ssb instance')
22+ throw new Error('*must* install feeds on ssb instance')
2323
2424 var queue = Queue(function (msg, prev, cb) {
25- if(prev) next(prev)
25+ if(prev && !opts.remote) next(prev)
2626 else
27- ssb.getLatest(keys.id, function (_, prev) { next(prev) })
27+ ssb.getLatest(keys.id, function (err, prev) {
28+ if(err) cb(err)
29+ else next(prev)
30+ })
2831
2932 function next (prev) {
3033 ssb.add(
3134 util.create(
@@ -60,4 +63,5 @@
6063 publish: publish
6164 }
6265 }
6366
67+

Built with git-ssb-web