ignite-boilerplate-andross-typescript
Version:
Customized version of ignite Andross With TypeScript Support.
23 lines (17 loc) • 510 B
text/typescript
import * as Immutable from "seamless-immutable";
import {Reducer} from "redux";
import {LoginState} from "./Types";
export const INITIAL_STATE = Immutable({
userName: '',
password:''
});
export const reducer: Reducer<LoginState> = (state: LoginState = INITIAL_STATE, action) => {
switch (action.type) {
case 'set_password':
return {...state, password:action.payload};
case 'set_user_name':
return {...state, userName:action.payload};
default:
return {...state};
}
};