How to use redux-batched-actions - 10 common examples

To help you get started, we’ve selected a few redux-batched-actions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nus-mtp / cubist / src / webapp / middlewares / transitionMiddleware.js View on Github external
.then(() => {
      const { RequestStore } = getState();
      const actions = RequestStore
        .get('navigateMap')
        .get(RequestStore.get('navigateId'))
        .toJS();
      dispatch(batchActions([
        ...actions,
        { type: NAVIGATE_COMPLETE },
        action
      ]));
      // Scroll to top after transition
      window.scrollTo(0, 0);
    });
};
github mattermost / mattermost-webapp / actions / websocket_actions.jsx View on Github external
return (myDispatch, myGetState) => {
        const posts = queue.map((msg) => JSON.parse(msg.data.post));

        // Receive the posts as one continuous block since they were received within a short period
        const actions = posts.map(receivedNewPost);
        myDispatch(batchActions(actions));

        // Load the posts' threads
        myDispatch(getThreadsForPosts(posts));

        // And any other data needed for them
        getProfilesAndStatusesForPosts(posts, myDispatch, myGetState);
    };
}
github machawk1 / wail / wail-ui / actions / heritrix.js View on Github external
return dispatch => {
    dispatch(batchActions([updateRuns, updateJobIds]))
    dispatch(startJob(conf.jobId))
  }
}
github i-novus-llc / n2o-framework / frontend / n2o / src / components / widgets / Table / headers / TextTableHeader.jsx View on Github external
toggleVisibility: ({ dispatch, widgetId, columnId }) => visible => {
      dispatch(
        batchActions([
          changeColumnVisiblity(widgetId, columnId, visible),
          changeFrozenColumn(widgetId, columnId),
        ])
      );
    },
  }),
github mattermost / mattermost-mobile / app / actions / views / right_menu_drawer.js View on Github external
return async (dispatch, getState) => {
        dispatch(batchActions([{
            type: NavigationTypes.NAVIGATION_CLOSE_DRAWERS
        }, {
            type: NavigationTypes.NAVIGATION_PUSH,
            route: {
                ...Routes.Search,
                props: {
                    searchType: 'recent_mentions'
                }
            }
        }]), getState);
    };
}
github mattermost / mattermost-mobile / app / actions / views / select_server.js View on Github external
return async (dispatch, getState) => {
        dispatch(batchActions([
            {type: GeneralTypes.CLIENT_CONFIG_RESET},
            {type: GeneralTypes.CLIENT_LICENSE_RESET},
            {type: ViewTypes.SERVER_URL_CHANGED, serverUrl},
        ]), getState);
    };
}
github mattermost / mattermost-mobile / service / store / configureStore.prod.js View on Github external
export default function configureServiceStore(preloadedState, appReducer) {
    const baseReducer = combineReducers(Object.assign({}, serviceReducer, appReducer));
    return createStore(
        enableBatching(baseReducer),
        preloadedState,
        applyMiddleware(thunk)
    );
}
github relayjs / relay-devtools / src / frontend / redux / store / configureStore.prod.js View on Github external
export default function configureStore(API) {
  const callAPIMiddleware = getAPIMiddleware(API);
  const middleware = [
    callAPIMiddleware,
    throwOnAsyncErrorMiddleware,
    thunkMiddleware,
    batchDispatchMiddleware,
  ];
  return createStore(enableBatching(reducer), applyMiddleware(...middleware));
}
github mattermost / mattermost-mobile / service / store / configureStore.dev.js View on Github external
function createReducer(...reducers) {
    const baseReducer = combineReducers(Object.assign({}, ...reducers));

    return enableFreezing(enableBatching(baseReducer));
}
github Talend / ui / packages / cmf / src / store.js View on Github external
function getReducer(appReducer) {
	let reducerObject = {};
	if (appReducer) {
		if (typeof appReducer === 'object') {
			reducerObject = Object.assign({}, appReducer);
		} else if (typeof appReducer === 'function') {
			reducerObject = { app: appReducer };
		}
	} else {
		invariant(true, 'Are you sure you want to bootstrap an app without reducers ?');
	}
	if (!reducerObject.cmf) {
		reducerObject.cmf = cmfReducers;
	}
	return enableBatching(preApplyReducer(combineReducers(reducerObject)));
}

redux-batched-actions

redux higher order reducer + action creator to reduce actions under a single subscriber notification

MIT
Latest version published 4 years ago

Package Health Score

50 / 100
Full package analysis