UNPKG

admin-on-rest-fr05t1k

Version:

A frontend Framework for building admin applications on top of REST services, using ES6, React and Material UI

18 lines (15 loc) 490 B
import { SHOW_NOTIFICATION, HIDE_NOTIFICATION } from '../actions/notificationActions'; const defaultState = { text: '', type: 'info', // one of 'info', 'confirm', 'warning' }; export default (previousState = defaultState, { type, payload }) => { switch (type) { case SHOW_NOTIFICATION: return { text: payload.text, type: payload.type }; case HIDE_NOTIFICATION: return { ...previousState, text: '' }; default: return previousState; } };