@ngxs/store 3.8.2-dev.master-414599c → 3.8.2-dev.master-e0981de
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/schematics/src/actions/files/__name__.actions.ts__template__ +2 -2
- package/schematics/src/starter-kit/files/store/auth/auth.actions.ts__template__ +2 -3
- package/schematics/src/starter-kit/files/store/auth/auth.state.ts__template__ +2 -2
- package/schematics/src/starter-kit/files/store/dashboard/states/dictionary/dictionary.actions.ts__template__ +3 -6
- package/schematics/src/starter-kit/files/store/dashboard/states/dictionary/dictionary.state.ts__template__ +4 -4
- package/schematics/src/starter-kit/files/store/dashboard/states/user/user.actions.ts__template__ +2 -2
- package/schematics/src/starter-kit/files/store/dashboard/states/user/user.state.ts__template__ +2 -2
- package/schematics/src/state/files/__name__.state.ts__template__ +1 -1
- package/schematics/src/state/state.factory.js +1 -1
- package/schematics/src/state/state.factory.js.map +1 -1
- package/schematics/src/store/files/__name__.actions.ts__template__ +3 -3
- package/schematics/src/store/files/__name__.state.ts__template__ +2 -2
- package/schematics/src/store/store.factory.js +1 -1
- package/schematics/src/store/store.factory.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AuthenticationStateModel } from './auth.state';
|
|
2
2
|
|
|
3
3
|
export class SetAuthData {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
constructor(public payload: AuthenticationStateModel) {}
|
|
4
|
+
static readonly type = '[Auth] Auth data';
|
|
5
|
+
constructor(readonly payload: AuthenticationStateModel) {}
|
|
7
6
|
}
|
|
@@ -25,7 +25,7 @@ export interface AuthenticationStateModel {
|
|
|
25
25
|
@Injectable()
|
|
26
26
|
export class AuthState {
|
|
27
27
|
@Selector()
|
|
28
|
-
|
|
28
|
+
static getAuthData(state: AuthenticationStateModel): AuthenticationStateModel {
|
|
29
29
|
return AuthState.getInstanceState(state);
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -38,7 +38,7 @@ export class AuthState {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
@Action(SetAuthData)
|
|
41
|
-
|
|
41
|
+
setAuthData(
|
|
42
42
|
{ setState }: StateContext<AuthenticationStateModel>,
|
|
43
43
|
{ payload }: SetAuthData
|
|
44
44
|
) {
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { DictionaryStateModel } from './dictionary.state';
|
|
2
2
|
|
|
3
3
|
export class SetDictionaryData {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
constructor(public payload: DictionaryStateModel) {}
|
|
4
|
+
static readonly type = '[Dictionary] Set dictionary data action';
|
|
5
|
+
constructor(readonly payload: DictionaryStateModel) {}
|
|
7
6
|
}
|
|
8
7
|
|
|
9
8
|
export class DictionaryReset {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
constructor() {}
|
|
9
|
+
static readonly type = '[Dictionary] Reset dictionary action';
|
|
13
10
|
}
|
|
@@ -23,12 +23,12 @@ export interface DictionaryStateModel {
|
|
|
23
23
|
@Injectable()
|
|
24
24
|
export class DictionaryState {
|
|
25
25
|
@Selector()
|
|
26
|
-
|
|
26
|
+
static getDictionaryState(state: DictionaryStateModel): DictionaryStateModel {
|
|
27
27
|
return DictionaryState.getInstanceState(state);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
@Selector()
|
|
31
|
-
|
|
31
|
+
static getDictionaryContent(state: DictionaryStateModel) {
|
|
32
32
|
return state.content;
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -41,7 +41,7 @@ export class DictionaryState {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
@Action(SetDictionaryData)
|
|
44
|
-
|
|
44
|
+
setTasks(
|
|
45
45
|
{ setState }: StateContext<DictionaryStateModel>,
|
|
46
46
|
{ payload }: SetDictionaryData
|
|
47
47
|
) {
|
|
@@ -49,7 +49,7 @@ export class DictionaryState {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
@Action(DictionaryReset)
|
|
52
|
-
|
|
52
|
+
resetTasks({ setState }: StateContext<DictionaryStateModel>) {
|
|
53
53
|
const initialState = {
|
|
54
54
|
content: [],
|
|
55
55
|
page: 0,
|
package/schematics/src/starter-kit/files/store/dashboard/states/user/user.actions.ts__template__
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UserStateModel } from './user.state';
|
|
2
2
|
|
|
3
3
|
export class SetUser {
|
|
4
|
-
|
|
5
|
-
constructor(
|
|
4
|
+
static readonly type = '[SetUser] action';
|
|
5
|
+
constructor(readonly payload: UserStateModel) {}
|
|
6
6
|
}
|
package/schematics/src/starter-kit/files/store/dashboard/states/user/user.state.ts__template__
CHANGED
|
@@ -31,12 +31,12 @@ export interface UserStateModel {
|
|
|
31
31
|
@Injectable()
|
|
32
32
|
export class UserState {
|
|
33
33
|
@Selector()
|
|
34
|
-
|
|
34
|
+
static getUser(state: UserStateModel): UserStateModel {
|
|
35
35
|
return state;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
@Action(SetUser)
|
|
39
|
-
|
|
39
|
+
setUser(ctx: StateContext<UserStateModel>, { payload }: SetUser) {
|
|
40
40
|
ctx.setState(payload);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -15,7 +15,7 @@ export interface <%= classify(name) %>StateModel {
|
|
|
15
15
|
export class <%= classify(name) %>State {
|
|
16
16
|
|
|
17
17
|
@Selector()
|
|
18
|
-
|
|
18
|
+
static getState(state: <%= classify(name) %>StateModel) {
|
|
19
19
|
return state;
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -19,7 +19,7 @@ function state(options) {
|
|
|
19
19
|
const path = options.flat
|
|
20
20
|
? normalizedOptions.path
|
|
21
21
|
: (0, path_1.join)(normalizedOptions.path, normalizedOptions.name);
|
|
22
|
-
return (0, generate_utils_1.generateFiles)((0, schematics_1.url)('./files'), path, Object.assign(Object.assign({},
|
|
22
|
+
return (0, generate_utils_1.generateFiles)((0, schematics_1.url)('./files'), path, Object.assign(Object.assign({}, normalizedOptions), { isStandalone }), options.spec);
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
exports.state = state;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.factory.js","sourceRoot":"","sources":["../../../../../packages/store/schematics/src/state/state.factory.ts"],"names":[],"mappings":";;;AAAA,2DAAkF;AAClF,+BAA4B;AAC5B,2DAAqD;AACrD,4DAAwD;AACxD,iEAAiE;AACjE,uDAA+D;AAC/D,kEAAkE;AAGlE,SAAgB,KAAK,CAAC,OAAoB;IACxC,OAAO,CAAC,IAAU,EAAE,EAAE;QACpB,IAAI,IAAA,oBAAO,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACzB,MAAM,IAAI,gCAAmB,CAAC,sCAAsC,CAAC,CAAC;SACvE;QAED,MAAM,QAAQ,GAAG,IAAA,4BAAkB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAC3D,MAAM,YAAY,GAAG,IAAA,8BAAe,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAErD,MAAM,iBAAiB,GAAG,IAAA,wCAAoB,EAAC,OAAO,CAAC,CAAC;QACxD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI;YACvB,CAAC,CAAC,iBAAiB,CAAC,IAAI;YACxB,CAAC,CAAC,IAAA,WAAI,EAAC,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAEzD,OAAO,IAAA,8BAAa,
|
|
1
|
+
{"version":3,"file":"state.factory.js","sourceRoot":"","sources":["../../../../../packages/store/schematics/src/state/state.factory.ts"],"names":[],"mappings":";;;AAAA,2DAAkF;AAClF,+BAA4B;AAC5B,2DAAqD;AACrD,4DAAwD;AACxD,iEAAiE;AACjE,uDAA+D;AAC/D,kEAAkE;AAGlE,SAAgB,KAAK,CAAC,OAAoB;IACxC,OAAO,CAAC,IAAU,EAAE,EAAE;QACpB,IAAI,IAAA,oBAAO,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACzB,MAAM,IAAI,gCAAmB,CAAC,sCAAsC,CAAC,CAAC;SACvE;QAED,MAAM,QAAQ,GAAG,IAAA,4BAAkB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAC3D,MAAM,YAAY,GAAG,IAAA,8BAAe,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAErD,MAAM,iBAAiB,GAAG,IAAA,wCAAoB,EAAC,OAAO,CAAC,CAAC;QACxD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI;YACvB,CAAC,CAAC,iBAAiB,CAAC,IAAI;YACxB,CAAC,CAAC,IAAA,WAAI,EAAC,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAEzD,OAAO,IAAA,8BAAa,EAClB,IAAA,gBAAG,EAAC,SAAS,CAAC,EACd,IAAI,kCACC,iBAAiB,KAAE,YAAY,KACpC,OAAO,CAAC,IAAI,CACb,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AArBD,sBAqBC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export class <%= classify(name) %>Action {
|
|
2
|
-
|
|
3
|
-
constructor(
|
|
4
|
-
}
|
|
2
|
+
static readonly type = '[<%= classify(name) %>] Add item';
|
|
3
|
+
constructor(readonly payload: string) { }
|
|
4
|
+
}
|
|
@@ -16,12 +16,12 @@ export interface <%= classify(name) %>StateModel {
|
|
|
16
16
|
export class <%= classify(name) %>State {
|
|
17
17
|
|
|
18
18
|
@Selector()
|
|
19
|
-
|
|
19
|
+
static getState(state: <%= classify(name) %>StateModel) {
|
|
20
20
|
return state;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
@Action(<%= classify(name) %>Action)
|
|
24
|
-
|
|
24
|
+
add(ctx: StateContext<<%= classify(name) %>StateModel>, { payload }: <%= classify(name) %>Action) {
|
|
25
25
|
const stateModel = ctx.getState();
|
|
26
26
|
stateModel.items = [...stateModel.items, payload];
|
|
27
27
|
ctx.setState(stateModel);
|
|
@@ -19,7 +19,7 @@ function store(options) {
|
|
|
19
19
|
const path = options.flat
|
|
20
20
|
? normalizedOptions.path
|
|
21
21
|
: (0, path_1.join)(normalizedOptions.path, normalizedOptions.name);
|
|
22
|
-
return (0, generate_utils_1.generateFiles)((0, schematics_1.url)('./files'), path, Object.assign(Object.assign({},
|
|
22
|
+
return (0, generate_utils_1.generateFiles)((0, schematics_1.url)('./files'), path, Object.assign(Object.assign({}, normalizedOptions), { isStandalone }), options.spec);
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
exports.store = store;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.factory.js","sourceRoot":"","sources":["../../../../../packages/store/schematics/src/store/store.factory.ts"],"names":[],"mappings":";;;AAAA,2DAAkF;AAClF,+BAA4B;AAC5B,2DAAqD;AACrD,4DAAwD;AACxD,iEAAiE;AACjE,uDAA+D;AAC/D,kEAAkE;AAGlE,SAAgB,KAAK,CAAC,OAAoB;IACxC,OAAO,CAAC,IAAU,EAAE,EAAE;QACpB,IAAI,IAAA,oBAAO,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACzB,MAAM,IAAI,gCAAmB,CAAC,sCAAsC,CAAC,CAAC;SACvE;QAED,MAAM,QAAQ,GAAG,IAAA,4BAAkB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAC3D,MAAM,YAAY,GAAG,IAAA,8BAAe,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAErD,MAAM,iBAAiB,GAAG,IAAA,wCAAoB,EAAC,OAAO,CAAC,CAAC;QACxD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI;YACvB,CAAC,CAAC,iBAAiB,CAAC,IAAI;YACxB,CAAC,CAAC,IAAA,WAAI,EAAC,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAEzD,OAAO,IAAA,8BAAa,
|
|
1
|
+
{"version":3,"file":"store.factory.js","sourceRoot":"","sources":["../../../../../packages/store/schematics/src/store/store.factory.ts"],"names":[],"mappings":";;;AAAA,2DAAkF;AAClF,+BAA4B;AAC5B,2DAAqD;AACrD,4DAAwD;AACxD,iEAAiE;AACjE,uDAA+D;AAC/D,kEAAkE;AAGlE,SAAgB,KAAK,CAAC,OAAoB;IACxC,OAAO,CAAC,IAAU,EAAE,EAAE;QACpB,IAAI,IAAA,oBAAO,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACzB,MAAM,IAAI,gCAAmB,CAAC,sCAAsC,CAAC,CAAC;SACvE;QAED,MAAM,QAAQ,GAAG,IAAA,4BAAkB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAC3D,MAAM,YAAY,GAAG,IAAA,8BAAe,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAErD,MAAM,iBAAiB,GAAG,IAAA,wCAAoB,EAAC,OAAO,CAAC,CAAC;QACxD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI;YACvB,CAAC,CAAC,iBAAiB,CAAC,IAAI;YACxB,CAAC,CAAC,IAAA,WAAI,EAAC,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAEzD,OAAO,IAAA,8BAAa,EAClB,IAAA,gBAAG,EAAC,SAAS,CAAC,EACd,IAAI,kCACC,iBAAiB,KAAE,YAAY,KACpC,OAAO,CAAC,IAAI,CACb,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AArBD,sBAqBC"}
|