export function showUpdate(billingCycle) { return [ showTabs('tabUpdate'), selectTab('tabUpdate'), initialize('billingCycleForm', billingCycle) ] }
function initializeState(store, ctx) { store.dispatch(initialize(constants.REDUX_FORM_NAME, {})); // allow to use http://localhost?todoId=4 to load initial todo const todoIdToInitialize = ctx.req.query.todoId || 1; // below actually returns a Promise which could be "await"'ed return store.dispatch(actions.fetchTodo(todoIdToInitialize)); }
const fetchEvent = (id) => { return function (dispatch) { dispatch({ type: types.FETCH_EVENTS, }); return fetch('/api/events/' + id, {}) .then(response => response.json()) .then((json) => { dispatch(initialize(forms.Event, json.data)); dispatch( { type: types.FETCH_EVENTS_SUCCESS, events: [json.data] }); }); }; }
export function init() { return [ showTabs('tabList', 'tabCreate'), selectTab('tabList'), getList(), initialize('billingCycleForm', INITIAL_VALUES) ] }
const fetchItem = (id) => { return function (dispatch) { dispatch({ type: types.FETCH_ITEMS, }); return fetch('/api/items/' + id, {}) .then(response => response.json()) .then((json) => { dispatch(initialize(forms.Item, json.data)); dispatch({ type: types.FETCH_ITEMS_SUCCESS, items: [json.data] }); }); }; }
export function showDelete(billingCycle) { return [ showTabs('tabDelete'), selectTab('tabDelete'), initialize('billingCycleForm', billingCycle) ] }
export function showUpdate(billingCycle) { return [ showTabs('tabUpdate'), selectTab('tabUpdate'), initialize('billingCycleForm', billingCycle) ] }
export function showDelete(billingCycle) { return [ showTabs('tabDelete'), selectTab('tabDelete'), initialize('billingCycleForm', billingCycle) ] }
export function init() { return [ showTabs('tabList', 'tabCreate'), selectTab('tabList'), getList(), initialize('billingCycleForm', INITIAL_VALUES) ] }