jpf 5.0.9 → 5.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/framework/observable.d.ts +3 -3
- package/dist/framework/observable.js +18 -18
- package/dist/framework/observable.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/framework/observable.ts +19 -19
- package/src/index.ts +2 -5
|
@@ -22,14 +22,14 @@ export interface IObservableMap<TKey, TValue> {
|
|
|
22
22
|
}
|
|
23
23
|
export interface IObservableSet<TItem> {
|
|
24
24
|
}
|
|
25
|
-
export declare const
|
|
25
|
+
export declare const implementations: {
|
|
26
26
|
unwrap: <TValue>(value: TValue | ISubscribable<TValue>) => TValue;
|
|
27
27
|
isComputed: (value: any) => value is IComputed<any>;
|
|
28
28
|
isObservableValue: (value: any) => value is IObservableValue<any, any>;
|
|
29
29
|
isObservableArray: (value: any) => value is IObservableArray<any, any[]>;
|
|
30
30
|
isObservableMap: <TKey, TItem>(value: any) => value is IObservableMap<TKey, TItem>;
|
|
31
31
|
isObservableSet: <TItem_1>(value: any) => value is IObservableSet<TItem_1>;
|
|
32
|
-
computed<TComputed>(func: () => TComputed)
|
|
32
|
+
computed: <TComputed>(func: () => TComputed) => IComputed<TComputed>;
|
|
33
33
|
observableValue: <TValue_1, TSetter = TValue_1>(value?: TValue_1, setter?: (value: TSetter, observableValue: IObservableValue<TValue_1, TSetter>) => void) => IObservableValue<TValue_1, TSetter>;
|
|
34
34
|
};
|
|
35
35
|
export declare function unwrap<TValue>(value: TValue | ISubscribable<TValue>): TValue;
|
|
@@ -38,7 +38,7 @@ export declare function isObservableValue(value: any): value is IObservableValue
|
|
|
38
38
|
export declare function isObservableArray(value: any): value is IObservableArray;
|
|
39
39
|
export declare function isObservableMap<TKey, TItem>(value: any): value is IObservableMap<TKey, TItem>;
|
|
40
40
|
export declare function isObservableSet<TItem>(value: any): value is IObservableSet<TItem>;
|
|
41
|
-
export declare function isSubscribable<TValue>(value: any): value is ISubscribable<TValue>;
|
|
42
41
|
export declare function computed<TComputed>(func: () => TComputed): IComputed<TComputed>;
|
|
43
42
|
export declare function observableValue<TValue, TSetter = TValue>(value?: TValue | null, setter?: (value: TSetter, observableValue: IObservableValue<TValue, TSetter>) => void): IObservableValue<TValue, TSetter>;
|
|
43
|
+
export declare function isSubscribable<TValue>(value: any): value is ISubscribable<TValue>;
|
|
44
44
|
export declare function executeHandlerOnObject(handler: (object: any) => void, object: object): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const implementations = {
|
|
2
2
|
unwrap: (value) => {
|
|
3
3
|
throw "Unwrap is not implemented";
|
|
4
4
|
},
|
|
@@ -17,7 +17,7 @@ export const observable = {
|
|
|
17
17
|
isObservableSet: (value) => {
|
|
18
18
|
throw "isObservableSet is not implemented";
|
|
19
19
|
},
|
|
20
|
-
computed(func) {
|
|
20
|
+
computed: (func) => {
|
|
21
21
|
throw "computed is not implemented";
|
|
22
22
|
},
|
|
23
23
|
observableValue: (value, setter) => {
|
|
@@ -25,35 +25,35 @@ export const observable = {
|
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
export function unwrap(value) {
|
|
28
|
-
return
|
|
28
|
+
return implementations.unwrap(value);
|
|
29
29
|
}
|
|
30
30
|
export function isComputed(value) {
|
|
31
|
-
return
|
|
31
|
+
return implementations.isComputed(value);
|
|
32
32
|
}
|
|
33
33
|
export function isObservableValue(value) {
|
|
34
|
-
return
|
|
34
|
+
return implementations.isObservableValue(value);
|
|
35
35
|
}
|
|
36
36
|
export function isObservableArray(value) {
|
|
37
|
-
return
|
|
37
|
+
return implementations.isObservableArray(value);
|
|
38
38
|
}
|
|
39
39
|
export function isObservableMap(value) {
|
|
40
|
-
return
|
|
40
|
+
return implementations.isObservableMap(value);
|
|
41
41
|
}
|
|
42
42
|
export function isObservableSet(value) {
|
|
43
|
-
return
|
|
44
|
-
}
|
|
45
|
-
export function isSubscribable(value) {
|
|
46
|
-
return observable.isComputed(value)
|
|
47
|
-
|| observable.isObservableValue(value)
|
|
48
|
-
|| observable.isObservableArray(value)
|
|
49
|
-
|| observable.isObservableMap(value)
|
|
50
|
-
|| observable.isObservableSet(value);
|
|
43
|
+
return implementations.isObservableSet(value);
|
|
51
44
|
}
|
|
52
45
|
export function computed(func) {
|
|
53
|
-
return
|
|
46
|
+
return implementations.computed(func);
|
|
54
47
|
}
|
|
55
48
|
export function observableValue(value, setter) {
|
|
56
|
-
return
|
|
49
|
+
return implementations.observableValue(value, setter);
|
|
50
|
+
}
|
|
51
|
+
export function isSubscribable(value) {
|
|
52
|
+
return implementations.isComputed(value)
|
|
53
|
+
|| implementations.isObservableValue(value)
|
|
54
|
+
|| implementations.isObservableArray(value)
|
|
55
|
+
|| implementations.isObservableMap(value)
|
|
56
|
+
|| implementations.isObservableSet(value);
|
|
57
57
|
}
|
|
58
58
|
export function executeHandlerOnObject(handler, object) {
|
|
59
59
|
if (object.constructor === Array) {
|
|
@@ -65,7 +65,7 @@ export function executeHandlerOnObject(handler, object) {
|
|
|
65
65
|
}
|
|
66
66
|
else {
|
|
67
67
|
if (isSubscribable(object)) {
|
|
68
|
-
const unwrapped =
|
|
68
|
+
const unwrapped = implementations.unwrap(object);
|
|
69
69
|
if (typeof unwrapped === "object") {
|
|
70
70
|
executeHandlerOnObject(handler, unwrapped);
|
|
71
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observable.js","sourceRoot":"","sources":["../../src/framework/observable.ts"],"names":[],"mappings":"AAiCA,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"observable.js","sourceRoot":"","sources":["../../src/framework/observable.ts"],"names":[],"mappings":"AAiCA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B,MAAM,EAAE,CAAS,KAAqC,EAAU,EAAE;QAC9D,MAAM,2BAA2B,CAAC;IACtC,CAAC;IAED,UAA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;gBAC7B,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;oBAC3C,sBAAsB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;gBAC9C,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import * as utilities from "./utilities/index";
|
|
|
3
3
|
import * as attributes from "./framework/attributes";
|
|
4
4
|
import * as element from "./framework/element";
|
|
5
5
|
import * as event from "./framework/event";
|
|
6
|
+
import * as observable from "./framework/observable";
|
|
6
7
|
import * as properties from "./framework/properties";
|
|
7
8
|
import * as root from "./framework/root";
|
|
8
9
|
import * as style from "./framework/style";
|
|
@@ -16,4 +17,4 @@ export { properties };
|
|
|
16
17
|
export { root };
|
|
17
18
|
export { style };
|
|
18
19
|
export { types };
|
|
19
|
-
export
|
|
20
|
+
export { observable };
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import * as utilities from "./utilities/index";
|
|
|
3
3
|
import * as attributes from "./framework/attributes";
|
|
4
4
|
import * as element from "./framework/element";
|
|
5
5
|
import * as event from "./framework/event";
|
|
6
|
+
import * as observable from "./framework/observable";
|
|
6
7
|
import * as properties from "./framework/properties";
|
|
7
8
|
import * as root from "./framework/root";
|
|
8
9
|
import * as style from "./framework/style";
|
|
@@ -16,5 +17,5 @@ export { properties };
|
|
|
16
17
|
export { root };
|
|
17
18
|
export { style };
|
|
18
19
|
export { types };
|
|
19
|
-
export
|
|
20
|
+
export { observable };
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAC/C,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAC/C,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -31,7 +31,7 @@ export interface IObservableSet<TItem> {
|
|
|
31
31
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export const
|
|
34
|
+
export const implementations = {
|
|
35
35
|
unwrap: <TValue>(value: TValue | ISubscribable<TValue>): TValue => {
|
|
36
36
|
throw "Unwrap is not implemented";
|
|
37
37
|
},
|
|
@@ -56,7 +56,7 @@ export const observable = {
|
|
|
56
56
|
throw "isObservableSet is not implemented";
|
|
57
57
|
},
|
|
58
58
|
|
|
59
|
-
computed<TComputed>(func: () => TComputed): IComputed<TComputed> {
|
|
59
|
+
computed: <TComputed>(func: () => TComputed): IComputed<TComputed> => {
|
|
60
60
|
throw "computed is not implemented";
|
|
61
61
|
},
|
|
62
62
|
|
|
@@ -65,43 +65,43 @@ export const observable = {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
export function unwrap<TValue>(value: TValue | ISubscribable<TValue>): TValue {
|
|
68
|
-
return
|
|
68
|
+
return implementations.unwrap(value);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
export function isComputed(value): value is IComputed<any> {
|
|
72
|
-
return
|
|
72
|
+
return implementations.isComputed(value);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
export function isObservableValue(value): value is IObservableValue {
|
|
76
|
-
return
|
|
76
|
+
return implementations.isObservableValue(value);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
export function isObservableArray(value): value is IObservableArray {
|
|
80
|
-
return
|
|
80
|
+
return implementations.isObservableArray(value);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
export function isObservableMap<TKey, TItem>(value): value is IObservableMap<TKey, TItem> {
|
|
84
|
-
return
|
|
84
|
+
return implementations.isObservableMap(value);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
export function isObservableSet<TItem>(value): value is IObservableSet<TItem> {
|
|
88
|
-
return
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export function isSubscribable<TValue>(value: any): value is ISubscribable<TValue> {
|
|
92
|
-
return observable.isComputed(value)
|
|
93
|
-
|| observable.isObservableValue(value)
|
|
94
|
-
|| observable.isObservableArray(value)
|
|
95
|
-
|| observable.isObservableMap(value)
|
|
96
|
-
|| observable.isObservableSet(value);
|
|
88
|
+
return implementations.isObservableSet(value);
|
|
97
89
|
}
|
|
98
90
|
|
|
99
91
|
export function computed<TComputed>(func: () => TComputed): IComputed<TComputed> {
|
|
100
|
-
return
|
|
92
|
+
return implementations.computed(func);
|
|
101
93
|
}
|
|
102
94
|
|
|
103
95
|
export function observableValue<TValue, TSetter = TValue>(value?: TValue | null, setter?: (value: TSetter, observableValue: IObservableValue<TValue, TSetter>) => void): IObservableValue<TValue, TSetter> {
|
|
104
|
-
return
|
|
96
|
+
return implementations.observableValue(value, setter);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function isSubscribable<TValue>(value: any): value is ISubscribable<TValue> {
|
|
100
|
+
return implementations.isComputed(value)
|
|
101
|
+
|| implementations.isObservableValue(value)
|
|
102
|
+
|| implementations.isObservableArray(value)
|
|
103
|
+
|| implementations.isObservableMap(value)
|
|
104
|
+
|| implementations.isObservableSet(value);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
|
|
@@ -115,7 +115,7 @@ export function executeHandlerOnObject(handler: (object) => void, object: object
|
|
|
115
115
|
}
|
|
116
116
|
} else {
|
|
117
117
|
if (isSubscribable(object)) {
|
|
118
|
-
const unwrapped =
|
|
118
|
+
const unwrapped = implementations.unwrap(object);
|
|
119
119
|
if (typeof unwrapped === "object") {
|
|
120
120
|
executeHandlerOnObject(handler, unwrapped);
|
|
121
121
|
}
|
package/src/index.ts
CHANGED
|
@@ -3,13 +3,12 @@ import * as utilities from "./utilities/index";
|
|
|
3
3
|
import * as attributes from "./framework/attributes";
|
|
4
4
|
import * as element from "./framework/element";
|
|
5
5
|
import * as event from "./framework/event";
|
|
6
|
-
|
|
6
|
+
import * as observable from "./framework/observable"
|
|
7
7
|
import * as properties from "./framework/properties";
|
|
8
8
|
import * as root from "./framework/root";
|
|
9
9
|
import * as style from "./framework/style";
|
|
10
10
|
import * as types from "./framework/types";
|
|
11
11
|
|
|
12
|
-
|
|
13
12
|
export { controls };
|
|
14
13
|
export { utilities };
|
|
15
14
|
export { attributes };
|
|
@@ -19,6 +18,4 @@ export { properties };
|
|
|
19
18
|
export { root };
|
|
20
19
|
export { style };
|
|
21
20
|
export { types };
|
|
22
|
-
|
|
23
|
-
export * from "./framework/observable";
|
|
24
|
-
|
|
21
|
+
export { observable };
|