git ssb

1+

Matt McKegg / mutant



Tree: 2244524e466413910788cad98baa61df4f340866

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

439 bytesRaw
1var Struct = require('../struct')
2
3var struct = Struct({
4 a: 'Hello',
5 b: 'You',
6 c: 123,
7 d: Struct({
8 tinker: 'value'
9 })
10})
11
12console.log(struct())
13struct(x => console.log(x))
14struct.a(x => console.log('a =>', x))
15struct.b(x => console.log('b =>', x))
16struct.c(x => console.log('c =>', x))
17struct.d(x => console.log('d =>', x))
18
19struct.b.set('Cat')
20
21struct.set({
22 a: 'Hello',
23 b: 'Cat',
24 c: 123,
25 d: {
26 tinker: 456
27 }
28})
29

Built with git-ssb-web