This commit is contained in:
crusader 2017-07-26 19:06:59 +09:00
parent d3c2449694
commit 6bd41d7355

View File

@ -1,22 +1,10 @@
import Action from '@overflow/commons/redux/Action'; import Action from '@overflow/commons/redux/Action';
import { ReducersMapObject } from 'redux'; import { ReducersMapObject } from 'redux';
import createReducer from '@overflow/commons/redux/createReducer';
import Member from '@overflow/member/api/model/Member'; import Member from '@overflow/member/api/model/Member';
import * as SigninActionTypes from '../action/signIn'; import * as SigninActionTypes from '../action/signIn';
import SigninState, { defaultState as signinDefaultState } from '../state/SignIn'; import SigninState, { defaultState as signinDefaultState } from '../state/SignIn';
// export type reducer = (state: SigninState, action: Action<Member | Error>) => SigninState;
// export const reducer: reducer = createReducer(signinDefaultState, {
// [SigninActionTypes.REQUEST_SUCCESS]: (state: SigninState = signinDefaultState, action: Action<Member>): SigninState => {
// return state;
// },
// [SigninActionTypes.REQUEST_FAILURE]: (state: SigninState = signinDefaultState, action: Action<Error>): SigninState => {
// return state;
// },
// });
const reducer: ReducersMapObject = { const reducer: ReducersMapObject = {
[SigninActionTypes.REQUEST_SUCCESS]: (state: SigninState = signinDefaultState, action: Action<Member>): SigninState => { [SigninActionTypes.REQUEST_SUCCESS]: (state: SigninState = signinDefaultState, action: Action<Member>): SigninState => {
return state; return state;
@ -27,25 +15,3 @@ const reducer: ReducersMapObject = {
}; };
export default reducer; export default reducer;
// export const reducer: reducer = (state: SigninState = signinDefaultState, action: Action<Member | Error>): SigninState => {
// switch (action.type) {
// case SigninActionTypes.REQUEST_SUCCESS:
// {
// let member = (<Action<Member>>action).payload;
// const aaa: SigninState = {
// ...state,
// isAuthenticated: true,
// };
// return aaa;
// }
// case SigninActionTypes.REQUEST_FAILURE:
// {
// return state;
// }
// default:
// return state;
// }
// };