-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLiveTransformHandler.index.js
58 lines (46 loc) · 1.24 KB
/
LiveTransformHandler.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
export class $$LiveTransformHandler {
static $$update(option) {
return (live_transform_handler) => live_transform_handler.$$update(option);
}
static $$append(option) {
return (live_transform_handler) => live_transform_handler.$$append(option);
}
static $$merge(option) {
return (live_transform_handler) => live_transform_handler.$$merge(option);
}
static $$wrap(live_transform) {
return new $$LiveTransformHandler(live_transform);
}
static $$unwrap(live_transform_handler) {
if (!live_transform_handler.live_transform) {
return;
}
live_transform_handler.live_transform.$$done();
return live_transform_handler.live_transform;
}
constructor(live_transform) {
this.live_transform = live_transform;
}
$$update(option) {
if (this.live_transform.$$getIsDone()) {
return this;
}
this.live_transform.$$update(option);
return this;
}
$$append(option) {
if (this.live_transform.$$getIsDone()) {
return this;
}
this.live_transform.$$append(option);
return this;
}
$$merge(option) {
if (this.live_transform.$$getIsDone()) {
return this;
}
this.live_transform.$$merge(option);
this.live_transform.$$done();
return this;
}
}