git ssb

1+

Matt McKegg / mutant



Tree: b9445832e31d8b9279595a8b40c71be0fc1bc40e

Files: b9445832e31d8b9279595a8b40c71be0fc1bc40e / test / test-concat.js

755 bytesRaw
1var Array = require('../array')
2var concat = require('../concat')
3var Map = require('../map')
4var Value = require('../value')
5var computed = require('../computed')
6
7var value = Value('human')
8var array = Array(['cat'])
9var array2 = Array(['cat'])
10var result = concat([array, array2])
11
12var map = Map(result, function (obj) {
13 if (typeof obj === 'function') {
14 console.log('mapping => obs')
15 return computed([obj], (x) => x + ' [dynamic]')
16 } else {
17 console.log('mapping => ', obj)
18 return obj + ' [static]'
19 }
20})
21
22result(x => console.log(x))
23map(x => console.log('[map]', x))
24
25array.push('dog')
26array2.push('cow')
27array.push(value)
28array2.push('chicken')
29array.push('wolf')
30array.delete('cat')
31array2.insert('sheep', 0)
32value.set('monkey')
33

Built with git-ssb-web