git ssb

0+

alanz / patchwork



forked from Matt McKegg / patchwork

Tree: b2886f60b5b31141643c0ea134c62b9e8e0db8e2

Files: b2886f60b5b31141643c0ea134c62b9e8e0db8e2 / modules / people-names.js

529 bytesRaw
1var Value = require('@mmckegg/mutant/value')
2var plugs = require('patchbay/plugs')
3var signifier = plugs.first(exports.signifier = [])
4var computed = require('@mmckegg/mutant/computed')
5
6exports.people_names = function (ids) {
7 return computed(Array.from(ids).map(ObservName), join) || ''
8}
9
10function join (...args) {
11 return args.join('\n')
12}
13
14function ObservName (id) {
15 var obs = Value(id.slice(0, 10))
16 signifier(id, (_, value) => {
17 if (value && value.length) {
18 obs.set(value[0].name)
19 }
20 })
21 return obs
22}
23

Built with git-ssb-web