@flashist/appframework 0.0.146 → 0.0.147
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/package.json +1 -1
- package/state/commands/WaitAppStorageDataChangeCommand.d.ts +9 -0
- package/state/commands/WaitAppStorageDataChangeCommand.js +29 -0
- package/state/commands/WaitAppStorageDataChangeCommand.js.map +1 -0
- package/state/commands/index.d.ts +1 -0
- package/state/commands/index.js +2 -0
- package/state/commands/index.js.map +1 -0
- package/state/index.d.ts +1 -0
- package/state/index.js +1 -0
- package/state/index.js.map +1 -1
package/package.json
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseAppCommand } from "../../base";
|
|
2
|
+
export declare class WaitAppStorageDataChageCommand extends BaseAppCommand {
|
|
3
|
+
protected deepKey: string;
|
|
4
|
+
protected value: any;
|
|
5
|
+
constructor(deepKey: string, value: any);
|
|
6
|
+
guard(): boolean;
|
|
7
|
+
protected getAppStorageValue(): any;
|
|
8
|
+
protected executeInternal(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BaseAppCommand } from "../../base";
|
|
2
|
+
import { appStateChangeEvent, appStorage } from "../AppStateModule";
|
|
3
|
+
export class WaitAppStorageDataChageCommand extends BaseAppCommand {
|
|
4
|
+
constructor(deepKey, value) {
|
|
5
|
+
super();
|
|
6
|
+
this.deepKey = deepKey;
|
|
7
|
+
this.value = value;
|
|
8
|
+
}
|
|
9
|
+
guard() {
|
|
10
|
+
let result = super.guard();
|
|
11
|
+
if (result) {
|
|
12
|
+
if (this.value == this.getAppStorageValue()) {
|
|
13
|
+
result = false;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
getAppStorageValue() {
|
|
19
|
+
return appStorage().getValue()(this.deepKey);
|
|
20
|
+
}
|
|
21
|
+
executeInternal() {
|
|
22
|
+
this.eventListenerHelper.addEventListener(this.globalDispatcher, appStateChangeEvent()(this.deepKey), () => {
|
|
23
|
+
if (this.value == this.getAppStorageValue()) {
|
|
24
|
+
this.notifyComplete();
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=WaitAppStorageDataChangeCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WaitAppStorageDataChangeCommand.js","sourceRoot":"","sources":["../../../src/state/commands/WaitAppStorageDataChangeCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpE,MAAM,OAAO,8BAA+B,SAAQ,cAAc;IAC9D,YAAsB,OAAe,EAAY,KAAU;QACvD,KAAK,EAAE,CAAC;QADU,YAAO,GAAP,OAAO,CAAQ;QAAY,UAAK,GAAL,KAAK,CAAK;IAE3D,CAAC;IAED,KAAK;QACD,IAAI,MAAM,GAAY,KAAK,CAAC,KAAK,EAAE,CAAC;QACpC,IAAI,MAAM,EAAE;YACR,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,kBAAkB,EAAE,EAAE;gBACzC,MAAM,GAAG,KAAK,CAAC;aAClB;SACJ;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;IAES,kBAAkB;QACxB,OAAQ,UAAU,EAAE,CAAC,QAAQ,EAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/D,CAAC;IAES,eAAe;QACrB,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CACrC,IAAI,CAAC,gBAAgB,EACpB,mBAAmB,EAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAC5C,GAAG,EAAE;YACD,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,kBAAkB,EAAE,EAAE;gBACzC,IAAI,CAAC,cAAc,EAAE,CAAC;aACzB;QACL,CAAC,CACJ,CAAA;IACL,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WaitAppStorageDataChangeCommand';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/state/commands/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
|
package/state/index.d.ts
CHANGED
package/state/index.js
CHANGED
package/state/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/state/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/state/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|