Commit e3cbdbaf0af7ab84de76704d47c517a5e21cc5e2
Pass msg.sync type messages through to mutant-pull-reduce.
Gordon Martin committed on 12/15/2017, 12:01:11 AMParent: 7ce1851294fbc4a8477cf9fb394510782f4d76b4
Files changed
backlinks/obs-filter.js | changed |
backlinks/obs-filter.js | ||
---|---|---|
@@ -46,9 +46,13 @@ | ||
46 | 46 … | var filterFunction = opts && opts.filter ? opts.filter : () => true |
47 | 47 … | |
48 | 48 … | var filteredBacklinks = pull( |
49 | 49 … | msgBacklinks, |
50 | - pull.filter(filterFunction) | |
50 … | + // We need to allow 'msg.sync' even if the supplied filter function does not | |
51 … | + // match it to allow mutant-pull-reduce to handle it for us and set the | |
52 … | + // 'sync' observable to indicate that the list is up to date with the messages | |
53 … | + // received so far. | |
54 … | + pull.filter(msg => msg.sync || filterFunction(msg)) | |
51 | 55 … | ) |
52 | 56 … | |
53 | 57 … | var backlinksObs = MutantPullReduce(filteredBacklinks, (state, msg) => { |
54 | 58 … | state.push(msg) |
Built with git-ssb-web