Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { createAction } from 'redux-actions';
export const Action = {
TOGGLE_MENU: 'TOGGLE_MENU',
};
const toggleMenu= createAction(Action.TOGGLE_MENU);
export function toggleMenuAction() {
return dispatch => dispatch(toggleMenu());
}
import { createAction } from 'redux-actions'
export const SET_MESSAGE = 'SET_MESSAGE'
export const setMessage = createAction(SET_MESSAGE)
import { createAction } from 'redux-actions';
export const SHOW_NOTIFICATION = 'SHOW_NOTIFICATION';
export const showNotification = createAction(SHOW_NOTIFICATION);
export const notify = (text, context) => dispatch => {
dispatch(
showNotification({
text,
context,
}),
);
};
import { createAction } from 'redux-actions'
export const ADD_FILTER = 'ADD_FILTER'
export const REMOVE_FILTER = 'REMOVE_FILTER'
export const ENABLE_FILTER = 'ENABLE_FILTER'
export const addFilter = createAction(ADD_FILTER)
export const removeFilter = createAction(REMOVE_FILTER)
export const enableFilter = createAction(ENABLE_FILTER)
import { createAction } from 'redux-actions'
export const ADD_FILTER = 'ADD_FILTER'
export const REMOVE_FILTER = 'REMOVE_FILTER'
export const ENABLE_FILTER = 'ENABLE_FILTER'
export const addFilter = createAction(ADD_FILTER)
export const removeFilter = createAction(REMOVE_FILTER)
export const enableFilter = createAction(ENABLE_FILTER)
const generateFunction = (fn, namespacing, topLevel) => {
if (topLevel) {
throw Error('Redux Enterprise: State Type custom functions cannot be used at the reducer top level.')
}
const namespace = namespacing.join('/')
return {
action: createAction(namespace),
reducers: {
[namespace]: scopeReductionFactory(namespacing, true)(fn),
},
}
}
function createActionInner(type, payloadCreator, metaCreator) {
return {
pending: cAction(type + PENDING, payloadCreator, metaCreator),
fulfilled: cAction(type + FULFILLED, payloadCreator, metaCreator),
};
}
const createRoutineAction = stage => {
const type = createActionType(prefix, stage, separator)
return createAction(type, payloadCreator, metaCreator)
}
return stages.reduce((routine, stage) => {