Files: 6564ad1491e92cadd2cd0c9f59444b6f8c8cdaf2 / modules / profile / obs / names.js
427 bytesRaw
1 | var nest = require('depnest') |
2 | var computed = require('mutant/computed') |
3 | |
4 | exports.needs = nest({ |
5 | 'about.obs.name': 'first' |
6 | }) |
7 | |
8 | exports.gives = nest({ |
9 | 'profile.obs': [ 'names' ] |
10 | }) |
11 | |
12 | exports.create = function (api) { |
13 | return nest({ |
14 | 'profile.obs': { names } |
15 | }) |
16 | |
17 | function names (ids) { |
18 | return computed(Array.from(ids).map(api.about.obs.name), join) || '' |
19 | } |
20 | } |
21 | |
22 | function join (...args) { |
23 | return args.join('\n') |
24 | } |
25 |
Built with git-ssb-web