Closed binarybaron closed 2 months ago
Is it possible to execute a middleware (for sideeffects) only in the main thread? I'm using the alpha 2.0 branch.
Currently, my store looks like this:
import { configureStore } from '@reduxjs/toolkit'; import { stateSyncEnhancer } from 'electron-redux'; // import... import alertsSlice from './features/alertsSlice'; export const store = configureStore({ reducer: { // ... alerts: alertsSlice, }, enhancers: [stateSyncEnhancer()], }); export type AppDispatch = typeof store.dispatch; export type RootState = ReturnType<typeof store.getState>;
Specifically I want to register a listener middleware to execute some code that can only be execute on the main thread.
Is it possible to execute a middleware (for sideeffects) only in the main thread? I'm using the alpha 2.0 branch.
Currently, my store looks like this:
Specifically I want to register a listener middleware to execute some code that can only be execute on the main thread.