Skip to content

Commit d81f4c2

Browse files
committed
feat(redux-saga): an example dealing with extra action type
1 parent c69bd9d commit d81f4c2

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/app/redux/modules/starsModule.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,9 @@ const initialState: IStars = {
1515

1616
/** Reducer */
1717
export function starsReducer(state: IStars = initialState, action: IStarsAction): IStars {
18+
// an example how you can deal with action type other than requesting types in promiseReducer
19+
if (action.type === LOAD_STARS) {
20+
return state;
21+
}
1822
return promiseReducer<IStars, IStarsAction>(requestType, state, action);
1923
}

0 commit comments

Comments
 (0)