Files
talk/client/coral-framework/reducers/notification.js
T
2017-01-30 15:11:16 -03:00

25 lines
496 B
JavaScript

import * as actions from '../actions/notification';
import {Map} from 'immutable';
const initialState = Map({
text: '',
type: '',
position: 400
});
export default (state = initialState, action) => {
switch (action.type) {
case actions.ADD_NOTIFICATION:
return state
.merge({
type: action.notifType,
text: action.text,
position: action.position
});
case actions.CLEAR_NOTIFICATION:
return initialState;
default:
return state;
}
};