git ssb

1+

Matt McKegg / mutant



Tree: 2244524e466413910788cad98baa61df4f340866

Files: 2244524e466413910788cad98baa61df4f340866 / test / test-map.js

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

Built with git-ssb-web