Last active
November 28, 2018 15:52
-
-
Save ngohungphuc/4ddfe0de4d041c46f38e864a2aab007b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {PortalActionsUnion, PortalActionTypes} from '../actions/portal.actions'; | |
| export interface PortalState { | |
| comment: string; | |
| } | |
| export const initialState: PortalState = { | |
| comment: 'some comments' | |
| }; | |
| export function reducer(state: PortalState = initialState, action: PortalActionsUnion): PortalState { | |
| switch (action.type) { | |
| case PortalActionTypes.ADD_COMMENT: | |
| return { | |
| ...state, | |
| comment: action.payload | |
| }; | |
| default: | |
| return state; | |
| } | |
| } | |
| export const getComments = (state: PortalState) => state.comment; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment