activator-oce-exporter
Version:
Extract Activator binder and convert it to valid OCE mono pacakge
128 lines (111 loc) • 2.5 kB
JavaScript
export const GET_STATE = 'GET_STATE';
export const PUSH_STATE = 'PUSH_STATE';
export const REMOVE_STATE = 'REMOVE_STATE';
export const TOGGLE_STATE = 'TOGGLE_STATE';
export const FORWARD_STATE = 'FORWARD_STATE';
export const BACKWARD_STATE = 'BACKWARD_STATE';
export const REGISTER_STATE = 'REGISTER_STATE';
export const UNREGISTER_STATE = 'UNREGISTER_STATE';
export const REREGISTER_STATE = 'REREGISTER_STATE';
export const SET_STATES = 'SET_STATES';
export const FREEZE = 'FREEZE';
export const UNFREEZE = 'UNFREEZE';
export const REGISTER_COMPONENT = 'REGISTER_COMPONENT';
export const SET_ACTIVATOR_ENV = 'SET_ACTIVATOR_ENV';
export const SET_VEEVA_ENV = 'SET_VEEVA_ENV';
export const getState = () => ({
type: GET_STATE,
});
export const pushState = state => (dispatch) => {
dispatch({
type: PUSH_STATE,
state,
});
};
export const removeState = state => (dispatch) => {
dispatch({
type: REMOVE_STATE,
state,
});
};
export const toggleState = state => (dispatch) => {
dispatch({
type: TOGGLE_STATE,
state,
});
};
export const forwardState = state => (dispatch) => {
dispatch({
type: FORWARD_STATE,
state,
});
};
export const backwardState = state => (dispatch) => {
dispatch({
type: BACKWARD_STATE,
state,
});
};
export const registerState = state => (dispatch) => {
dispatch({
type: REGISTER_STATE,
state,
});
};
export const unregisterState = state => (dispatch) => {
dispatch({
type: UNREGISTER_STATE,
state,
});
};
export const reRegisterState = state => (dispatch) => {
dispatch({
type: REREGISTER_STATE,
state,
});
};
export const registerComponent = component => (dispatch) => {
dispatch({
type: REGISTER_COMPONENT,
component,
});
};
// Replace current list of states
export const setStates = stateList => (dispatch) => {
dispatch({
type: SET_STATES,
stateList,
});
};
export const freeze = state => (dispatch) => {
dispatch({
type: FREEZE,
state,
});
};
export const unfreeze = state => (dispatch) => {
dispatch({
type: UNFREEZE,
state,
});
};
export const applyStates = stateList => (dispatch) => {
stateList.forEach((state) => {
dispatch({
type: PUSH_STATE,
state,
});
});
};
export const setActivatorEnv = state => (dispatch) => {
dispatch({
type: SET_ACTIVATOR_ENV,
state,
});
};
export const setVeevaEnv = state => (dispatch) => {
dispatch({
type: SET_VEEVA_ENV,
state,
});
};