Skip to content

Instantly share code, notes, and snippets.

@tmontoya-ias
Last active April 11, 2016 16:48
Show Gist options
  • Save tmontoya-ias/f3dc20e8b090b14b7c3c687afee8efc4 to your computer and use it in GitHub Desktop.
Save tmontoya-ias/f3dc20e8b090b14b7c3c687afee8efc4 to your computer and use it in GitHub Desktop.
import Immutable from 'immutable';
import {CLIENTS_FIND} from './constants';
const initialState = Immutable.Map({
status: "processed",
keyword: "reducer",
responseClients: []
});
export default (state = initialState, action) => {
switch (action.type) {
case CLIENTS_FIND:
const response = action.payload.data;
return state.withMutations(map => {
map
.set('status', 'processed')
.set('responseClients', response.listClients);
})
break;
default:
return state;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment