git ssb

10+

Matt McKegg / patchwork



Tree: 05c5b4f2078be5153b1a4ff2c0f7455a930242b1

Files: 05c5b4f2078be5153b1a4ff2c0f7455a930242b1 / 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