@vnejs/plugins.views.screens.loading 0.1.11 → 0.1.13
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ModuleCore } from "@vnejs/module.core";
|
|
2
2
|
import type { LoadingPluginConstants, LoadingPluginEvents, LoadingPluginParams, LoadingPluginSettings } from "../types.js";
|
|
3
3
|
import type { LoadingEmitPayload, LoadingPluginState } from "../utils/loading.js";
|
|
4
|
-
export declare class Loading extends
|
|
4
|
+
export declare class Loading extends ModuleCore<LoadingPluginEvents, LoadingPluginConstants, LoadingPluginSettings, LoadingPluginParams, LoadingPluginState> {
|
|
5
5
|
name: string;
|
|
6
6
|
subscribe: () => void;
|
|
7
7
|
onLoadingEmit: ({ promiseFunc }?: LoadingEmitPayload) => Promise<void>;
|
package/dist/modules/loading.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export class Loading extends
|
|
1
|
+
import { ModuleCore } from "@vnejs/module.core";
|
|
2
|
+
export class Loading extends ModuleCore {
|
|
3
3
|
name = "loading";
|
|
4
4
|
subscribe = () => {
|
|
5
5
|
this.on(this.EVENTS.LOADING.EMIT, this.onLoadingEmit);
|
|
6
6
|
};
|
|
7
7
|
onLoadingEmit = async ({ promiseFunc } = {}) => {
|
|
8
|
-
this.
|
|
8
|
+
this.emitLog({ action: "start" });
|
|
9
9
|
await this.emit(this.EVENTS.LOADING.SHOW);
|
|
10
10
|
await Promise.all([promiseFunc?.(), this.waitTimeout(this.PARAMS.LOADING.MIN_SHOW_TIME)]);
|
|
11
11
|
await this.emit(this.EVENTS.LOADING.HIDE);
|
|
12
|
-
this.
|
|
12
|
+
this.emitLog({ action: "finish" });
|
|
13
13
|
};
|
|
14
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vnejs/plugins.views.screens.loading",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -33,11 +33,8 @@
|
|
|
33
33
|
"@vnejs/plugins.views.screens.loading.contract": "~0.1.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@vnejs/module": "~0.1.0",
|
|
36
|
+
"@vnejs/module.core": "~0.1.0",
|
|
37
37
|
"@vnejs/module.components": "~0.1.0",
|
|
38
|
-
"@vnejs/plugins.core.logs.contract": "~0.1.0",
|
|
39
|
-
"@vnejs/plugins.core.memory.contract": "~0.1.0",
|
|
40
|
-
"@vnejs/plugins.core.system.contract": "~0.1.0",
|
|
41
38
|
"@vnejs/plugins.text.locs.contract": "~0.1.0",
|
|
42
39
|
"@vnejs/shared": "~0.1.0",
|
|
43
40
|
"@vnejs/uis.react": "~0.1.0"
|
package/src/modules/loading.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ModuleCore } from "@vnejs/module.core";
|
|
2
2
|
|
|
3
3
|
import type { LoadingPluginConstants, LoadingPluginEvents, LoadingPluginParams, LoadingPluginSettings } from "../types.js";
|
|
4
4
|
import type { LoadingEmitPayload, LoadingPluginState } from "../utils/loading.js";
|
|
5
5
|
|
|
6
|
-
export class Loading extends
|
|
6
|
+
export class Loading extends ModuleCore<
|
|
7
7
|
LoadingPluginEvents,
|
|
8
8
|
LoadingPluginConstants,
|
|
9
9
|
LoadingPluginSettings,
|
|
@@ -17,10 +17,10 @@ export class Loading extends Module<
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
onLoadingEmit = async ({ promiseFunc }: LoadingEmitPayload = {}) => {
|
|
20
|
-
this.
|
|
20
|
+
this.emitLog({ action: "start" });
|
|
21
21
|
await this.emit(this.EVENTS.LOADING.SHOW);
|
|
22
22
|
await Promise.all([promiseFunc?.(), this.waitTimeout(this.PARAMS.LOADING.MIN_SHOW_TIME)]);
|
|
23
23
|
await this.emit(this.EVENTS.LOADING.HIDE);
|
|
24
|
-
this.
|
|
24
|
+
this.emitLog({ action: "finish" });
|
|
25
25
|
};
|
|
26
26
|
}
|