Redux toolkit how to preload async function state
Unanswered
Masai Lion posted this in #help-forum
Masai LionOP
How would I pass an async function to the configureStore preloadedState?
I cant use
import { configureStore } from '@reduxjs/toolkit';
export const store = configureStore({
reducer: { main },
preloadedState: loadState(),
});
store.subscribe(debounce(() => saveState(store.getState()), 500));I cant use
async loadState() cause it throws an error and theres no top level await in client components