Files: 30936e93cd05ef20992cd348fcf9d6a68059ea4c / test / test-concat.js
755 bytesRaw
1 | var Array = require('../array') |
2 | var concat = require('../concat') |
3 | var Map = require('../map') |
4 | var Value = require('../value') |
5 | var computed = require('../computed') |
6 | |
7 | var value = Value('human') |
8 | var array = Array(['cat']) |
9 | var array2 = Array(['cat']) |
10 | var result = concat([array, array2]) |
11 | |
12 | var 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 | |
22 | result(x => console.log(x)) |
23 | map(x => console.log('[map]', x)) |
24 | |
25 | array.push('dog') |
26 | array2.push('cow') |
27 | array.push(value) |
28 | array2.push('chicken') |
29 | array.push('wolf') |
30 | array.delete('cat') |
31 | array2.insert('sheep', 0) |
32 | value.set('monkey') |
33 |
Built with git-ssb-web