@shuvi/platform-shared 1.0.4 → 1.0.6
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/esm/shared/application.d.ts +3 -3
- package/esm/shared/application.js +6 -6
- package/esm/shared/applicationTypes.d.ts +6 -6
- package/esm/shared/index.d.ts +2 -2
- package/esm/shared/index.js +2 -2
- package/esm/shared/models/error.d.ts +5 -8
- package/esm/shared/models/error.js +9 -14
- package/esm/shared/models/loader.d.ts +5 -8
- package/esm/shared/models/loader.js +5 -11
- package/lib/shared/application.d.ts +3 -3
- package/lib/shared/application.js +4 -4
- package/lib/shared/applicationTypes.d.ts +6 -6
- package/lib/shared/index.d.ts +2 -2
- package/lib/shared/index.js +3 -1
- package/lib/shared/models/error.d.ts +5 -8
- package/lib/shared/models/error.js +11 -16
- package/lib/shared/models/loader.d.ts +5 -8
- package/lib/shared/models/loader.js +7 -13
- package/package.json +9 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IRouter, IPageRouteRecord } from './routerTypes';
|
|
2
|
-
import {
|
|
2
|
+
import { Doura, Application, IAppContext, ApplicationOptions, IRerenderConfig, IError } from './applicationTypes';
|
|
3
3
|
export declare class ApplicationImpl<Config extends {} = {}> {
|
|
4
4
|
private _router;
|
|
5
5
|
private _appComponent;
|
|
@@ -15,13 +15,13 @@ export declare class ApplicationImpl<Config extends {} = {}> {
|
|
|
15
15
|
get context(): IAppContext;
|
|
16
16
|
get pluginManager(): import("@shuvi/hook").HookManager<import("./runtimPlugin").RuntimePluginHooks, void>;
|
|
17
17
|
get appComponent(): any;
|
|
18
|
-
get error(): IError |
|
|
18
|
+
get error(): IError | null;
|
|
19
19
|
setError(err: IError): void;
|
|
20
20
|
clearError(): void;
|
|
21
21
|
getLoadersData(): Record<string, any>;
|
|
22
22
|
setLoadersData(datas: Record<string, any>): void;
|
|
23
23
|
init(): Promise<void>;
|
|
24
|
-
get store():
|
|
24
|
+
get store(): Doura;
|
|
25
25
|
updateComponents({ AppComponent }?: IRerenderConfig): Promise<void>;
|
|
26
26
|
dispose(): Promise<void>;
|
|
27
27
|
private _initPlugin;
|
|
@@ -9,17 +9,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { getManager } from './runtimPlugin';
|
|
11
11
|
import { initPlugins } from './runtimPlugin';
|
|
12
|
-
import {
|
|
13
|
-
import { errorModel } from './models/error';
|
|
14
|
-
import { loaderModel } from './models/loader';
|
|
12
|
+
import { doura } from 'doura';
|
|
13
|
+
import { errorModel, errorModelName } from './models/error';
|
|
14
|
+
import { loaderModel, loaderModelName } from './models/loader';
|
|
15
15
|
export class ApplicationImpl {
|
|
16
16
|
constructor(options) {
|
|
17
17
|
this._config = options.config;
|
|
18
18
|
this._router = options.router;
|
|
19
19
|
this._context = {};
|
|
20
|
-
this._store =
|
|
21
|
-
this._error = this._store.getModel(errorModel);
|
|
22
|
-
this._loader = this._store.getModel(loaderModel);
|
|
20
|
+
this._store = doura({ initialState: options.initialState });
|
|
21
|
+
this._error = this._store.getModel(errorModelName, errorModel);
|
|
22
|
+
this._loader = this._store.getModel(loaderModelName, loaderModel);
|
|
23
23
|
this._appComponent = options.AppComponent;
|
|
24
24
|
this._pluginManager = getManager();
|
|
25
25
|
initPlugins(this._pluginManager, options.plugins || []);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Doura } from 'doura';
|
|
2
2
|
import { CustomAppContext } from '@shuvi/runtime';
|
|
3
3
|
import { IRouter, IPageRouteRecord } from './routerTypes';
|
|
4
4
|
import { IPluginList } from './runtimPlugin';
|
|
@@ -8,7 +8,7 @@ export interface IAppContext extends CustomAppContext {
|
|
|
8
8
|
export declare type IRerenderConfig = {
|
|
9
9
|
AppComponent?: any;
|
|
10
10
|
};
|
|
11
|
-
export type {
|
|
11
|
+
export type { Doura };
|
|
12
12
|
export declare type ErrorSource = 'server';
|
|
13
13
|
export interface IError {
|
|
14
14
|
code?: number;
|
|
@@ -18,18 +18,18 @@ export interface IError {
|
|
|
18
18
|
source?: ErrorSource;
|
|
19
19
|
}
|
|
20
20
|
export interface IErrorState {
|
|
21
|
-
error
|
|
21
|
+
error: IError | null;
|
|
22
22
|
}
|
|
23
23
|
export declare type IAppState = {
|
|
24
|
-
error
|
|
24
|
+
error: IErrorState;
|
|
25
25
|
};
|
|
26
26
|
export interface Application<Config extends {} = {}> {
|
|
27
27
|
readonly config: Config;
|
|
28
28
|
readonly context: IAppContext;
|
|
29
29
|
readonly router: IRouter<IPageRouteRecord>;
|
|
30
30
|
readonly appComponent: any;
|
|
31
|
-
readonly store:
|
|
32
|
-
readonly error:
|
|
31
|
+
readonly store: Doura;
|
|
32
|
+
readonly error: IErrorState['error'];
|
|
33
33
|
setError(err: IError): void;
|
|
34
34
|
clearError(): void;
|
|
35
35
|
getLoadersData(): Record<string, any>;
|
package/esm/shared/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ export * from './routerTypes';
|
|
|
3
3
|
export * from './router';
|
|
4
4
|
export * from './response';
|
|
5
5
|
export * from './loader';
|
|
6
|
-
export { errorModel } from './models/error';
|
|
7
|
-
export { loaderModel } from './models/loader';
|
|
6
|
+
export { errorModel, errorModelName } from './models/error';
|
|
7
|
+
export { loaderModel, loaderModelName } from './models/loader';
|
|
8
8
|
export * from './applicationTypes';
|
|
9
9
|
export type { ApplicationImpl } from './application';
|
|
10
10
|
export type { IRuntimeConfig } from './runtimeConfigTypes';
|
package/esm/shared/index.js
CHANGED
|
@@ -3,7 +3,7 @@ export * from './routerTypes';
|
|
|
3
3
|
export * from './router';
|
|
4
4
|
export * from './response';
|
|
5
5
|
export * from './loader';
|
|
6
|
-
export { errorModel } from './models/error';
|
|
7
|
-
export { loaderModel } from './models/loader';
|
|
6
|
+
export { errorModel, errorModelName } from './models/error';
|
|
7
|
+
export { loaderModel, loaderModelName } from './models/loader';
|
|
8
8
|
export * from './applicationTypes';
|
|
9
9
|
export { createRuntimePlugin, createRuntimePluginBefore, createRuntimePluginAfter } from './runtimPlugin';
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { IErrorState, IError } from '../applicationTypes';
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
}, {
|
|
7
|
-
set(payload?: IError): void;
|
|
2
|
+
export declare const errorModelName = "error";
|
|
3
|
+
export declare const errorModel: import("doura").DefineModel<IErrorState, {
|
|
4
|
+
set(error?: IError): void;
|
|
8
5
|
clear(): void;
|
|
9
6
|
}, {
|
|
10
|
-
errorObject(): IError |
|
|
7
|
+
errorObject(): IError | null;
|
|
11
8
|
hasError(): boolean;
|
|
12
|
-
},
|
|
9
|
+
}, unknown>;
|
|
13
10
|
export declare type ErrorModel = typeof errorModel;
|
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
import { defineModel } from '
|
|
1
|
+
import { defineModel } from 'doura';
|
|
2
2
|
import { SHUVI_ERROR } from '@shuvi/shared/lib/constants';
|
|
3
|
-
const
|
|
4
|
-
error:
|
|
3
|
+
const DEFAULT_ERROR_STATE = {
|
|
4
|
+
error: null
|
|
5
5
|
};
|
|
6
|
+
export const errorModelName = 'error';
|
|
6
7
|
export const errorModel = defineModel({
|
|
7
|
-
|
|
8
|
-
state: DEFAULT_ERRORSTATE,
|
|
9
|
-
reducers: {
|
|
10
|
-
setError(_state, error) {
|
|
11
|
-
return Object.assign(Object.assign({}, _state), { error: error });
|
|
12
|
-
}
|
|
13
|
-
},
|
|
8
|
+
state: DEFAULT_ERROR_STATE,
|
|
14
9
|
actions: {
|
|
15
|
-
set(
|
|
16
|
-
this.
|
|
10
|
+
set(error = SHUVI_ERROR.APP_ERROR) {
|
|
11
|
+
this.error = error;
|
|
17
12
|
},
|
|
18
13
|
clear() {
|
|
19
14
|
if (this.hasError) {
|
|
20
|
-
this.
|
|
15
|
+
this.error = null;
|
|
21
16
|
}
|
|
22
17
|
}
|
|
23
18
|
},
|
|
@@ -26,7 +21,7 @@ export const errorModel = defineModel({
|
|
|
26
21
|
return this.error;
|
|
27
22
|
},
|
|
28
23
|
hasError() {
|
|
29
|
-
return
|
|
24
|
+
return this.error !== null;
|
|
30
25
|
}
|
|
31
26
|
}
|
|
32
27
|
});
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
export interface LoaderState {
|
|
2
2
|
dataByRouteId: Record<string, any>;
|
|
3
3
|
}
|
|
4
|
-
export declare const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
}, import("@shuvi/redox/esm/core/defineModel").ActionOptions, {
|
|
4
|
+
export declare const loaderModelName = "loader";
|
|
5
|
+
export declare const loaderModel: import("doura").DefineModel<LoaderState, {
|
|
6
|
+
setDatas(newData: Record<string, any>): void;
|
|
7
|
+
}, {
|
|
11
8
|
getAllData(): Record<string, any>;
|
|
12
|
-
},
|
|
9
|
+
}, unknown>;
|
|
13
10
|
export declare type LoaderModel = typeof loaderModel;
|
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
import { defineModel } from '
|
|
1
|
+
import { defineModel } from 'doura';
|
|
2
2
|
const initState = {
|
|
3
3
|
dataByRouteId: {}
|
|
4
4
|
};
|
|
5
|
+
export const loaderModelName = 'loader';
|
|
5
6
|
export const loaderModel = defineModel({
|
|
6
|
-
name: 'loader',
|
|
7
7
|
state: initState,
|
|
8
|
-
|
|
9
|
-
setDatas(
|
|
10
|
-
|
|
8
|
+
actions: {
|
|
9
|
+
setDatas(newData) {
|
|
10
|
+
this.dataByRouteId = Object.assign(Object.assign({}, this.dataByRouteId), newData);
|
|
11
11
|
}
|
|
12
|
-
// clearDatas(state) {
|
|
13
|
-
// return {
|
|
14
|
-
// ...state,
|
|
15
|
-
// dataByRouteId: {}
|
|
16
|
-
// };
|
|
17
|
-
// }
|
|
18
12
|
},
|
|
19
13
|
views: {
|
|
20
14
|
getAllData() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IRouter, IPageRouteRecord } from './routerTypes';
|
|
2
|
-
import {
|
|
2
|
+
import { Doura, Application, IAppContext, ApplicationOptions, IRerenderConfig, IError } from './applicationTypes';
|
|
3
3
|
export declare class ApplicationImpl<Config extends {} = {}> {
|
|
4
4
|
private _router;
|
|
5
5
|
private _appComponent;
|
|
@@ -15,13 +15,13 @@ export declare class ApplicationImpl<Config extends {} = {}> {
|
|
|
15
15
|
get context(): IAppContext;
|
|
16
16
|
get pluginManager(): import("@shuvi/hook").HookManager<import("./runtimPlugin").RuntimePluginHooks, void>;
|
|
17
17
|
get appComponent(): any;
|
|
18
|
-
get error(): IError |
|
|
18
|
+
get error(): IError | null;
|
|
19
19
|
setError(err: IError): void;
|
|
20
20
|
clearError(): void;
|
|
21
21
|
getLoadersData(): Record<string, any>;
|
|
22
22
|
setLoadersData(datas: Record<string, any>): void;
|
|
23
23
|
init(): Promise<void>;
|
|
24
|
-
get store():
|
|
24
|
+
get store(): Doura;
|
|
25
25
|
updateComponents({ AppComponent }?: IRerenderConfig): Promise<void>;
|
|
26
26
|
dispose(): Promise<void>;
|
|
27
27
|
private _initPlugin;
|
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.ApplicationImpl = void 0;
|
|
13
13
|
const runtimPlugin_1 = require("./runtimPlugin");
|
|
14
14
|
const runtimPlugin_2 = require("./runtimPlugin");
|
|
15
|
-
const
|
|
15
|
+
const doura_1 = require("doura");
|
|
16
16
|
const error_1 = require("./models/error");
|
|
17
17
|
const loader_1 = require("./models/loader");
|
|
18
18
|
class ApplicationImpl {
|
|
@@ -20,9 +20,9 @@ class ApplicationImpl {
|
|
|
20
20
|
this._config = options.config;
|
|
21
21
|
this._router = options.router;
|
|
22
22
|
this._context = {};
|
|
23
|
-
this._store = (0,
|
|
24
|
-
this._error = this._store.getModel(error_1.errorModel);
|
|
25
|
-
this._loader = this._store.getModel(loader_1.loaderModel);
|
|
23
|
+
this._store = (0, doura_1.doura)({ initialState: options.initialState });
|
|
24
|
+
this._error = this._store.getModel(error_1.errorModelName, error_1.errorModel);
|
|
25
|
+
this._loader = this._store.getModel(loader_1.loaderModelName, loader_1.loaderModel);
|
|
26
26
|
this._appComponent = options.AppComponent;
|
|
27
27
|
this._pluginManager = (0, runtimPlugin_1.getManager)();
|
|
28
28
|
(0, runtimPlugin_2.initPlugins)(this._pluginManager, options.plugins || []);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Doura } from 'doura';
|
|
2
2
|
import { CustomAppContext } from '@shuvi/runtime';
|
|
3
3
|
import { IRouter, IPageRouteRecord } from './routerTypes';
|
|
4
4
|
import { IPluginList } from './runtimPlugin';
|
|
@@ -8,7 +8,7 @@ export interface IAppContext extends CustomAppContext {
|
|
|
8
8
|
export declare type IRerenderConfig = {
|
|
9
9
|
AppComponent?: any;
|
|
10
10
|
};
|
|
11
|
-
export type {
|
|
11
|
+
export type { Doura };
|
|
12
12
|
export declare type ErrorSource = 'server';
|
|
13
13
|
export interface IError {
|
|
14
14
|
code?: number;
|
|
@@ -18,18 +18,18 @@ export interface IError {
|
|
|
18
18
|
source?: ErrorSource;
|
|
19
19
|
}
|
|
20
20
|
export interface IErrorState {
|
|
21
|
-
error
|
|
21
|
+
error: IError | null;
|
|
22
22
|
}
|
|
23
23
|
export declare type IAppState = {
|
|
24
|
-
error
|
|
24
|
+
error: IErrorState;
|
|
25
25
|
};
|
|
26
26
|
export interface Application<Config extends {} = {}> {
|
|
27
27
|
readonly config: Config;
|
|
28
28
|
readonly context: IAppContext;
|
|
29
29
|
readonly router: IRouter<IPageRouteRecord>;
|
|
30
30
|
readonly appComponent: any;
|
|
31
|
-
readonly store:
|
|
32
|
-
readonly error:
|
|
31
|
+
readonly store: Doura;
|
|
32
|
+
readonly error: IErrorState['error'];
|
|
33
33
|
setError(err: IError): void;
|
|
34
34
|
clearError(): void;
|
|
35
35
|
getLoadersData(): Record<string, any>;
|
package/lib/shared/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ export * from './routerTypes';
|
|
|
3
3
|
export * from './router';
|
|
4
4
|
export * from './response';
|
|
5
5
|
export * from './loader';
|
|
6
|
-
export { errorModel } from './models/error';
|
|
7
|
-
export { loaderModel } from './models/loader';
|
|
6
|
+
export { errorModel, errorModelName } from './models/error';
|
|
7
|
+
export { loaderModel, loaderModelName } from './models/loader';
|
|
8
8
|
export * from './applicationTypes';
|
|
9
9
|
export type { ApplicationImpl } from './application';
|
|
10
10
|
export type { IRuntimeConfig } from './runtimeConfigTypes';
|
package/lib/shared/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.createRuntimePluginAfter = exports.createRuntimePluginBefore = exports.createRuntimePlugin = exports.loaderModel = exports.errorModel = void 0;
|
|
17
|
+
exports.createRuntimePluginAfter = exports.createRuntimePluginBefore = exports.createRuntimePlugin = exports.loaderModelName = exports.loaderModel = exports.errorModelName = exports.errorModel = void 0;
|
|
18
18
|
__exportStar(require("./helper"), exports);
|
|
19
19
|
__exportStar(require("./routerTypes"), exports);
|
|
20
20
|
__exportStar(require("./router"), exports);
|
|
@@ -22,8 +22,10 @@ __exportStar(require("./response"), exports);
|
|
|
22
22
|
__exportStar(require("./loader"), exports);
|
|
23
23
|
var error_1 = require("./models/error");
|
|
24
24
|
Object.defineProperty(exports, "errorModel", { enumerable: true, get: function () { return error_1.errorModel; } });
|
|
25
|
+
Object.defineProperty(exports, "errorModelName", { enumerable: true, get: function () { return error_1.errorModelName; } });
|
|
25
26
|
var loader_1 = require("./models/loader");
|
|
26
27
|
Object.defineProperty(exports, "loaderModel", { enumerable: true, get: function () { return loader_1.loaderModel; } });
|
|
28
|
+
Object.defineProperty(exports, "loaderModelName", { enumerable: true, get: function () { return loader_1.loaderModelName; } });
|
|
27
29
|
__exportStar(require("./applicationTypes"), exports);
|
|
28
30
|
var runtimPlugin_1 = require("./runtimPlugin");
|
|
29
31
|
Object.defineProperty(exports, "createRuntimePlugin", { enumerable: true, get: function () { return runtimPlugin_1.createRuntimePlugin; } });
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { IErrorState, IError } from '../applicationTypes';
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
}, {
|
|
7
|
-
set(payload?: IError): void;
|
|
2
|
+
export declare const errorModelName = "error";
|
|
3
|
+
export declare const errorModel: import("doura").DefineModel<IErrorState, {
|
|
4
|
+
set(error?: IError): void;
|
|
8
5
|
clear(): void;
|
|
9
6
|
}, {
|
|
10
|
-
errorObject(): IError |
|
|
7
|
+
errorObject(): IError | null;
|
|
11
8
|
hasError(): boolean;
|
|
12
|
-
},
|
|
9
|
+
}, unknown>;
|
|
13
10
|
export declare type ErrorModel = typeof errorModel;
|
|
@@ -1,26 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.errorModel = void 0;
|
|
4
|
-
const
|
|
3
|
+
exports.errorModel = exports.errorModelName = void 0;
|
|
4
|
+
const doura_1 = require("doura");
|
|
5
5
|
const constants_1 = require("@shuvi/shared/lib/constants");
|
|
6
|
-
const
|
|
7
|
-
error:
|
|
6
|
+
const DEFAULT_ERROR_STATE = {
|
|
7
|
+
error: null
|
|
8
8
|
};
|
|
9
|
-
exports.
|
|
10
|
-
|
|
11
|
-
state:
|
|
12
|
-
reducers: {
|
|
13
|
-
setError(_state, error) {
|
|
14
|
-
return Object.assign(Object.assign({}, _state), { error: error });
|
|
15
|
-
}
|
|
16
|
-
},
|
|
9
|
+
exports.errorModelName = 'error';
|
|
10
|
+
exports.errorModel = (0, doura_1.defineModel)({
|
|
11
|
+
state: DEFAULT_ERROR_STATE,
|
|
17
12
|
actions: {
|
|
18
|
-
set(
|
|
19
|
-
this.
|
|
13
|
+
set(error = constants_1.SHUVI_ERROR.APP_ERROR) {
|
|
14
|
+
this.error = error;
|
|
20
15
|
},
|
|
21
16
|
clear() {
|
|
22
17
|
if (this.hasError) {
|
|
23
|
-
this.
|
|
18
|
+
this.error = null;
|
|
24
19
|
}
|
|
25
20
|
}
|
|
26
21
|
},
|
|
@@ -29,7 +24,7 @@ exports.errorModel = (0, redox_1.defineModel)({
|
|
|
29
24
|
return this.error;
|
|
30
25
|
},
|
|
31
26
|
hasError() {
|
|
32
|
-
return
|
|
27
|
+
return this.error !== null;
|
|
33
28
|
}
|
|
34
29
|
}
|
|
35
30
|
});
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
export interface LoaderState {
|
|
2
2
|
dataByRouteId: Record<string, any>;
|
|
3
3
|
}
|
|
4
|
-
export declare const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
}, import("@shuvi/redox/esm/core/defineModel").ActionOptions, {
|
|
4
|
+
export declare const loaderModelName = "loader";
|
|
5
|
+
export declare const loaderModel: import("doura").DefineModel<LoaderState, {
|
|
6
|
+
setDatas(newData: Record<string, any>): void;
|
|
7
|
+
}, {
|
|
11
8
|
getAllData(): Record<string, any>;
|
|
12
|
-
},
|
|
9
|
+
}, unknown>;
|
|
13
10
|
export declare type LoaderModel = typeof loaderModel;
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.loaderModel = void 0;
|
|
4
|
-
const
|
|
3
|
+
exports.loaderModel = exports.loaderModelName = void 0;
|
|
4
|
+
const doura_1 = require("doura");
|
|
5
5
|
const initState = {
|
|
6
6
|
dataByRouteId: {}
|
|
7
7
|
};
|
|
8
|
-
exports.
|
|
9
|
-
|
|
8
|
+
exports.loaderModelName = 'loader';
|
|
9
|
+
exports.loaderModel = (0, doura_1.defineModel)({
|
|
10
10
|
state: initState,
|
|
11
|
-
|
|
12
|
-
setDatas(
|
|
13
|
-
|
|
11
|
+
actions: {
|
|
12
|
+
setDatas(newData) {
|
|
13
|
+
this.dataByRouteId = Object.assign(Object.assign({}, this.dataByRouteId), newData);
|
|
14
14
|
}
|
|
15
|
-
// clearDatas(state) {
|
|
16
|
-
// return {
|
|
17
|
-
// ...state,
|
|
18
|
-
// dataByRouteId: {}
|
|
19
|
-
// };
|
|
20
|
-
// }
|
|
21
15
|
},
|
|
22
16
|
views: {
|
|
23
17
|
getAllData() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shuvi/platform-shared",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/shuvijs/shuvi.git",
|
|
@@ -83,17 +83,17 @@
|
|
|
83
83
|
"node": ">= 12.0.0"
|
|
84
84
|
},
|
|
85
85
|
"dependencies": {
|
|
86
|
-
"@shuvi/hook": "1.0.
|
|
87
|
-
"
|
|
88
|
-
"@shuvi/router": "1.0.
|
|
89
|
-
"@shuvi/runtime": "1.0.
|
|
90
|
-
"@shuvi/shared": "1.0.
|
|
91
|
-
"@shuvi/toolpack": "1.0.
|
|
92
|
-
"@shuvi/utils": "1.0.
|
|
86
|
+
"@shuvi/hook": "1.0.6",
|
|
87
|
+
"doura": "0.0.3",
|
|
88
|
+
"@shuvi/router": "1.0.6",
|
|
89
|
+
"@shuvi/runtime": "1.0.6",
|
|
90
|
+
"@shuvi/shared": "1.0.6",
|
|
91
|
+
"@shuvi/toolpack": "1.0.6",
|
|
92
|
+
"@shuvi/utils": "1.0.6",
|
|
93
93
|
"redux": "4.1.2"
|
|
94
94
|
},
|
|
95
95
|
"peerDependencies": {
|
|
96
|
-
"@shuvi/service": "1.0.
|
|
96
|
+
"@shuvi/service": "1.0.6"
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
99
|
"@shuvi/service": "workspace:*",
|