- implementing immutable.js
This commit is contained in:
17
app/reducers/profile.js
Normal file
17
app/reducers/profile.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import { Map } from 'immutable';
|
||||
|
||||
import {
|
||||
SET_PROFILE,
|
||||
UPDATE_PROFILE,
|
||||
} from '../constants/actionTypes.js';
|
||||
|
||||
export const profile = (state = new Map(), action) => {
|
||||
switch (action.type) {
|
||||
case SET_PROFILE:
|
||||
return action.payload;
|
||||
case UPDATE_PROFILE:
|
||||
return action.payload;
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user