-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
executable file
·79 lines (65 loc) · 2.79 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import State from './script.js';
console.log('------------------------------------------begin----------------------------------------');
let myState = State.create({
range: {
start: 1,
end: 5 },
visible: true
});
console.log('------------------------------------------1----------------------------------------');
console.log("--->1",myState.getState());
myState.create('range.type', {
absolute: true
});
myState.create({ focus: null });
console.log("--->2",myState.prop('range.type'));
myState.prop('visible', true);
console.log('------------------------------------------2----------------------------------------');
myState.on('range.start', (oldVal, newVal) => {
console.log('Value before prop change', oldVal);
console.log('Value after prop change', newVal);
});
myState.prop('range.start', 9);
console.log('------------------------------------------3----------------------------------------');
myState.on('range', (oldVal, newVal) => {
console.log('Value before prop change', oldVal);
console.log('Value after prop change', newVal);
});
myState.prop('range.start', 10);
myState.prop('range.type.absolute', false);
console.log('------------------------------------------4----------------------------------------');
myState.next('range', (oldVal, newVal) => {
console.log('Value before prop change', oldVal);
console.log('Value after prop change', newVal);
});
myState.prop('range.start', 11);
myState.prop('range.end', 12);
console.log('------------------------------------------5----------------------------------------');
myState.on('range', (oldVal, newVal) => {
console.log('Value before prop change', oldVal);
console.log('Value after prop change', newVal);
});
myState.prop('range.start', 12);
myState.prop('range.end', 13);
console.log('------------------------------------------6----------------------------------------');
myState.on('range', (oldVal, newVal) => {
console.log('Value before prop change', oldVal);
console.log('Value after prop change', newVal);
});
myState.lock();
myState.prop('range.start', 13)
myState.prop('range.end', 14)
myState.unlock();
console.log('------------------------------------------7----------------------------------------');
myState.on('range.start.man', (oldVal, newVal) => {
console.log('Value before prop change', oldVal);
console.log('Value after prop change', newVal);
});
myState.prop('range.start', { 'man': 'monologue' });
console.log('------------------------------------------8----------------------------------------');
myState.on('range', (oldVal, newVal) => {
console.log('Value before prop change', oldVal);
console.log('Value after prop change', newVal);
});
myState.prop('range.start', { 'man': 'monologue' });
console.log('------------------------------------------end----------------------------------------');