@reduxjs/toolkit#compose TypeScript Examples

The following examples show how to use @reduxjs/toolkit#compose. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: reducerInjectors.test.ts    From datart with Apache License 2.0 6 votes vote down vote up
function configureStore() {
  const createReducer = (injectedReducers = {}) =>
    combineReducers({
      ...injectedReducers,
      nonInjected: (s = {}) => s,
    });

  const enhancers = [injectReducerEnhancer(createReducer)];

  const store = createStore(createReducer(), {}, compose(...enhancers));

  return store;
}
Example #2
Source File: store.ts    From baidu-pan-downloader with MIT License 5 votes vote down vote up
composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
  ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({ trace: true, traceLimit: 10 })
  : compose