dev
Last change
on this file since 6d639c9 was 6d639c9, checked in by Стојков Марко <mst@…>, 3 years ago |
Ngrx store for question
|
-
Property mode
set to
100644
|
File size:
856 bytes
|
Line | |
---|
1 | import { QuestionAction, QuestionActionTypes } from './question.actions';
|
---|
2 | import { initialState, QuestionState } from './question.state';
|
---|
3 |
|
---|
4 | export function reducer(state = initialState, action: QuestionAction): QuestionState {
|
---|
5 | switch (action.type) {
|
---|
6 | case QuestionActionTypes.GetQuestionStateSuccess:
|
---|
7 | return {
|
---|
8 | ...state,
|
---|
9 | question: action.payload
|
---|
10 | };
|
---|
11 | case QuestionActionTypes.EffectStartedWorking: {
|
---|
12 | return {
|
---|
13 | ...state,
|
---|
14 | effectWorking: true
|
---|
15 | };
|
---|
16 | }
|
---|
17 |
|
---|
18 | case QuestionActionTypes.EffectFinishedWorking: {
|
---|
19 | return {
|
---|
20 | ...state,
|
---|
21 | effectWorking: false
|
---|
22 | };
|
---|
23 | }
|
---|
24 |
|
---|
25 | case QuestionActionTypes.EffectFinishedWorkingError: {
|
---|
26 | return {
|
---|
27 | ...state,
|
---|
28 | effectWorking: action.payload
|
---|
29 | };
|
---|
30 | }
|
---|
31 |
|
---|
32 | default: {
|
---|
33 | return {
|
---|
34 | ...state
|
---|
35 | };
|
---|
36 | }
|
---|
37 | }
|
---|
38 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.