-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
70b3c37
commit 043fcb3
Showing
6 changed files
with
29 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,20 @@ | ||
import * as types from '../constants/ActionTypes'; | ||
import * as types from "../constants/ActionTypes"; | ||
|
||
|
||
const initialState = { | ||
import { createReducer } from "redux-immutablejs"; | ||
import Immutable from "immutable"; | ||
const initialState = Immutable.fromJS({ | ||
loading: false, | ||
entries:[] | ||
}; | ||
|
||
export default function category(state = initialState, action) { | ||
entries: [] | ||
}); | ||
|
||
switch (action.type) { | ||
case types.FETCH_DETAIL_INFO: | ||
return Object.assign({}, state, { | ||
loading: true | ||
}); | ||
case types.RECEIVE_DETAIL_INFO: | ||
return Object.assign({}, state, { | ||
loading: false, | ||
entries: action.entries | ||
}); | ||
default: | ||
return state; | ||
} | ||
} | ||
export default createReducer(initialState, { | ||
[types.FETCH_DETAIL_INFO]: state => | ||
state.merge({ | ||
loading: true | ||
}), | ||
[types.RECEIVE_DETAIL_INFO]: (state, action) => | ||
state.merge({ | ||
loading: false, | ||
entries: action.entries | ||
}) | ||
}); |
This file contains 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
This file contains 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