gnar-edge
Version:
A sharp set of utilities: base64, drain, handleChange, jwt, notifications
12 lines (9 loc) • 671 B
JavaScript
import { createAction } from 'redux-actions';
import { ADD_NOTIFICATION, DISMISS_NOTIFICATION } from './reducers';
export default {
dismissNotification: createAction(DISMISS_NOTIFICATION, key => ({ key })),
notifyError: createAction(ADD_NOTIFICATION, (message, opts = {}) => ({ message, ...opts, variant: 'error' })),
notifyInfo: createAction(ADD_NOTIFICATION, (message, opts = {}) => ({ message, ...opts, variant: 'info' })),
notifySuccess: createAction(ADD_NOTIFICATION, (message, opts = {}) => ({ message, ...opts, variant: 'success' })),
notifyWarning: createAction(ADD_NOTIFICATION, (message, opts = {}) => ({ message, ...opts, variant: 'warning' }))
};