@reduxjs/toolkit#getDefaultMiddleware TypeScript Examples

The following examples show how to use @reduxjs/toolkit#getDefaultMiddleware. 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: index.ts    From mozartfinance-swap-interface with GNU General Public License v3.0 6 votes vote down vote up
store = configureStore({
  reducer: {
    application,
    user,
    transactions,
    swap,
    mint,
    burn,
    multicall,
    lists,
    toasts
  },
  middleware: [...getDefaultMiddleware({ thunk: false }), save({ states: PERSISTED_KEYS })],
  preloadedState: loadedState,
})
Example #2
Source File: index.ts    From pancakeswap-testnet with GNU General Public License v3.0 6 votes vote down vote up
store = configureStore({
  reducer: {
    application,
    user,
    transactions,
    swap,
    mint,
    burn,
    multicall,
    lists,
    toasts
  },
  // middleware: [...getDefaultMiddleware({ thunk: false }), save({ states: PERSISTED_KEYS })],
  middleware: getDefaultMiddleware({ thunk: false }).concat(save({ states: PERSISTED_KEYS })),
  preloadedState: loadedState,
})
Example #3
Source File: index.ts    From vvs-ui with GNU General Public License v3.0 6 votes vote down vote up
store = configureStore({
  devTools: process.env.NODE_ENV !== 'production',
  reducer: {
    // achievements: achievementsReducer,
    block: blockReducer,
    farms: farmsReducer,
    pools: poolsReducer,
    // predictions: predictionsReducer,
    profile: profileReducer,
    // teams: teamsReducer,
    // collectibles: collectiblesReducer,
    // voting: votingReducer,
    // lottery: lotteryReducer,
    info: infoReducer,

    // Exchange
    user,
    transactions,
    swap,
    mint,
    burn,
    multicall,
    lists,
  },
  middleware: [...getDefaultMiddleware({ thunk: true }), save({ states: PERSISTED_KEYS })],
  preloadedState: load({ states: PERSISTED_KEYS }),
})
Example #4
Source File: configureStore.ts    From optica with Apache License 2.0 6 votes vote down vote up
configureAppStore = (preloadedState: PartialRootState = {}) => {
    const store = configureStore({
        reducer: rootReducer,
        middleware: [...getDefaultMiddleware<RootState>()],
        preloadedState,
    });

    return store;
}
Example #5
Source File: configureStore.ts    From covid19-trend-map with Apache License 2.0 6 votes vote down vote up
configureAppStore = (preloadedState:PartialRootState = {})=>{

    const store = configureStore({
        reducer: rootReducer,
        middleware:[ 
            ...getDefaultMiddleware<RootState>()
        ],
        preloadedState
    });

    return store
}
Example #6
Source File: index.ts    From forward.swaps with GNU General Public License v3.0 6 votes vote down vote up
store = configureStore({
  reducer: {
    application,
    user,
    transactions,
    swap,
    mint,
    burn,
    multicall,
    lists,
    waitmodal
  },
  middleware: [...getDefaultMiddleware({ thunk: false }), save({ states: PERSISTED_KEYS })],
  preloadedState: load({ states: PERSISTED_KEYS })
})
Example #7
Source File: configureStore.ts    From react-boilerplate-cra-template with MIT License 6 votes vote down vote up
export function configureAppStore() {
  const reduxSagaMonitorOptions = {};
  const sagaMiddleware = createSagaMiddleware(reduxSagaMonitorOptions);
  const { run: runSaga } = sagaMiddleware;

  // Create the store with saga middleware
  const middlewares = [sagaMiddleware];

  const enhancers = [
    createInjectorsEnhancer({
      createReducer,
      runSaga,
    }),
  ] as StoreEnhancer[];

  const store = configureStore({
    reducer: createReducer(),
    middleware: [...getDefaultMiddleware(), ...middlewares],
    devTools:
      /* istanbul ignore next line */
      process.env.NODE_ENV !== 'production' ||
      process.env.PUBLIC_URL.length > 0,
    enhancers,
  });

  return store;
}
Example #8
Source File: configureStore.ts    From react-boilerplate-cra-template with MIT License 6 votes vote down vote up
export function configureAppStore() {
  const reduxSagaMonitorOptions = {};
  const sagaMiddleware = createSagaMiddleware(reduxSagaMonitorOptions);
  const { run: runSaga } = sagaMiddleware;

  // Create the store with saga middleware
  const middlewares = [sagaMiddleware];

  const enhancers = [
    createInjectorsEnhancer({
      createReducer,
      runSaga,
    }),
  ] as StoreEnhancer[];

  const store = configureStore({
    reducer: createReducer(),
    middleware: [...getDefaultMiddleware(), ...middlewares],
    devTools: process.env.NODE_ENV !== 'production',
    enhancers,
  });

  return store;
}
Example #9
Source File: index.ts    From pancake-swap-exchange-testnet with GNU General Public License v3.0 6 votes vote down vote up
store = configureStore({
  reducer: {
    application,
    user,
    transactions,
    swap,
    mint,
    burn,
    multicall,
    lists,
    toasts
  },
  // @ts-ignore
  middleware: [...getDefaultMiddleware({ thunk: false }), save({ states: PERSISTED_KEYS })],
  // @ts-ignore
  preloadedState: loadedState,
})
Example #10
Source File: index.ts    From cuiswap with GNU General Public License v3.0 6 votes vote down vote up
store = configureStore({
  reducer: {
    application,
    user,
    transactions,
    swap,
    mint,
    burn,
    multicall,
    lists
  },
  middleware: [...getDefaultMiddleware(), save({ states: PERSISTED_KEYS })],
  preloadedState: load({ states: PERSISTED_KEYS })
})
Example #11
Source File: index.ts    From skeleton-web3-interface with GNU General Public License v3.0 6 votes vote down vote up
store = configureStore({
  reducer: {
    application,
    user,
    transactions,
    multicall,
    lists
  },
  middleware: [...getDefaultMiddleware({ thunk: false }), save({ states: PERSISTED_KEYS })],
  preloadedState: load({ states: PERSISTED_KEYS })
})
Example #12
Source File: index.ts    From goose-frontend-amm with GNU General Public License v3.0 6 votes vote down vote up
store = configureStore({
  reducer: {
    application,
    user,
    transactions,
    swap,
    mint,
    burn,
    multicall,
    lists,
  },
  middleware: [...getDefaultMiddleware({ thunk: false }), save({ states: PERSISTED_KEYS })],
  preloadedState: loadedState,
})
Example #13
Source File: index.ts    From sybil-interface with GNU General Public License v3.0 6 votes vote down vote up
store = configureStore({
  reducer: {
    application,
    user,
    transactions,
    multicall,
    governance,
    social,
  },
  middleware: [...getDefaultMiddleware({ thunk: false }), save({ states: PERSISTED_KEYS })],
  preloadedState: load({ states: PERSISTED_KEYS }),
})
Example #14
Source File: store.ts    From prism-frontend with MIT License 6 votes vote down vote up
store = configureStore({
  reducer,
  middleware: getDefaultMiddleware({
    // TODO: Instead of snoozing this check, we might want to
    // serialize the state
    serializableCheck: false,
    immutableCheck: {
      ignoredPaths: ['mapState.layersData', 'analysisResultState.result'],
    },
  }).concat(errorToNotificationMiddleware),
})
Example #15
Source File: store.ts    From celo-web-wallet with MIT License 6 votes vote down vote up
store = configureStore({
  reducer: rootReducer,
  // Disable thunk, use saga instead
  middleware: [
    ...getDefaultMiddleware({
      thunk: false,
      //redux-persist uses non-serializable actions
      serializableCheck: {
        ignoredActions: [PERSIST, REHYDRATE],
      },
    }),
    sagaMiddleware,
  ],
  devTools: config.debug,
})
Example #16
Source File: index.ts    From cheeseswap-interface with GNU General Public License v3.0 6 votes vote down vote up
store = configureStore({
  reducer: {
    application,
    user,
    transactions,
    swap,
    mint,
    burn,
    multicall,
    lists
  },
  middleware: [...getDefaultMiddleware({ thunk: false }), save({ states: PERSISTED_KEYS })],
  preloadedState: load({ states: PERSISTED_KEYS })
})
Example #17
Source File: index.ts    From dyp with Do What The F*ck You Want To Public License 6 votes vote down vote up
store = configureStore({
  reducer: {
    application,
    user,
    transactions,
    swap,
    mint,
    burn,
    multicall,
    lists
  },
  middleware: [...getDefaultMiddleware({ thunk: false }), save({ states: PERSISTED_KEYS })],
  preloadedState: load({ states: PERSISTED_KEYS })
})
Example #18
Source File: index.ts    From glide-frontend with GNU General Public License v3.0 6 votes vote down vote up
store = configureStore({
  devTools: process.env.NODE_ENV !== 'production',
  reducer: {
    // achievements: achievementsReducer,
    block: blockReducer,
    farms: farmsReducer,
    pools: poolsReducer,
    community: communityReducer,
    info: infoReducer,
    // predictions: predictionsReducer,
    // profile: profileReducer,
    // teams: teamsReducer,
    collectibles: collectiblesReducer,
    // voting: votingReducer,
    // lottery: lotteryReducer,

    // Exchange
    application,
    user,
    transactions,
    swap,
    bridge,
    mint,
    burn,
    multicall,
    lists,
  },
  middleware: [...getDefaultMiddleware({ thunk: true }), save({ states: PERSISTED_KEYS })],
  preloadedState: load({ states: PERSISTED_KEYS }),
})
Example #19
Source File: store.ts    From react-native-template with MIT License 5 votes vote down vote up
store = configureStore({
  reducer: rootReducer,
  middleware: [epicMiddleware, sentryMiddleware, ...getDefaultMiddleware()],
  // Only create reactotron enhancer in DEV
  enhancers: (__DEV__ && [reactotron.createEnhancer()]) || undefined,
  devTools: true,
})
Example #20
Source File: index.tsx    From Riakuto-StartingReact-ja3.1 with Apache License 2.0 5 votes vote down vote up
store = configureStore({
  reducer: userSlice.reducer,
  middleware: [...getDefaultMiddleware({ thunk: false }), sagaMiddleWare],
})
Example #21
Source File: index.tsx    From Riakuto-StartingReact-ja3.1 with Apache License 2.0 5 votes vote down vote up
store = configureStore({
  reducer: userSlice.reducer,
  middleware: [...getDefaultMiddleware({ thunk: false })],
})
Example #22
Source File: store.ts    From deskreen with GNU Affero General Public License v3.0 5 votes vote down vote up
middleware = [...getDefaultMiddleware(), router]
Example #23
Source File: store.ts    From baidu-pan-downloader with MIT License 5 votes vote down vote up
middleware = [fastLoggerMiddleware, ...getDefaultMiddleware({ serializableCheck: false })]
Example #24
Source File: index.ts    From dendron with GNU Affero General Public License v3.0 5 votes vote down vote up
middleware = [...getDefaultMiddleware()]
Example #25
Source File: store.ts    From prompts-ai with MIT License 5 votes vote down vote up
middlewares = [
    ...getDefaultMiddleware({
        serializableCheck: false,
        immutableCheck: false}),
    createStateSyncMiddleware({blacklist: [PERSIST, PURGE, REHYDRATE]}),
]
Example #26
Source File: store.ts    From webminidisc with GNU General Public License v2.0 5 votes vote down vote up
store = configureStore({
    reducer: resetStateReducer,
    middleware: [errorCatcher, ...getDefaultMiddleware()],
})
Example #27
Source File: store.ts    From pali-wallet with MIT License 5 votes vote down vote up
middleware: any = [
  ...getDefaultMiddleware({ thunk: false, serializableCheck: false }),
]
Example #28
Source File: index.ts    From jellyfin-audio-player with MIT License 5 votes vote down vote up
store = configureStore({
    reducer: persistedReducer,
    middleware: getDefaultMiddleware({ serializableCheck: false, immutableCheck: false }).concat(
        // logger,
        ...middlewares,
    ),
})
Example #29
Source File: store.ts    From nyxo-app with GNU General Public License v3.0 5 votes vote down vote up
store = configureStore({
  reducer: persistedReducer,
  middleware: getDefaultMiddleware({
    serializableCheck: {
      ignoredActions: [FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER]
    }
  })
})