git ssb

10+

Matt McKegg / patchwork



Tree: b6089670d854fcefa6bc5ca05636a801707deb30

Files: b6089670d854fcefa6bc5ca05636a801707deb30 / 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