feat: nested collections (#680)
This commit is contained in:
committed by
GitHub
parent
22a1b8d9c0
commit
d0ecae310c
@ -3,6 +3,10 @@ import { configureStore } from '@reduxjs/toolkit';
|
||||
import createRootReducer from '../reducers/combinedReducer';
|
||||
import { waitUntilAction } from './middleware/waitUntilAction';
|
||||
|
||||
import type { BaseField, UnknownField } from '../interface';
|
||||
import type { CollectionsState } from '../reducers/collections';
|
||||
import type { ConfigState } from '../reducers/config';
|
||||
|
||||
const store = configureStore({
|
||||
reducer: createRootReducer(),
|
||||
middleware: getDefaultMiddleware =>
|
||||
@ -13,6 +17,12 @@ const store = configureStore({
|
||||
});
|
||||
|
||||
export { store };
|
||||
export type RootState = ReturnType<typeof store.getState>;
|
||||
export type RootState<EF extends BaseField = UnknownField> = Omit<
|
||||
ReturnType<typeof store.getState>,
|
||||
'collection' | 'config'
|
||||
> & {
|
||||
collection: CollectionsState<EF>;
|
||||
config: ConfigState<EF>;
|
||||
};
|
||||
export type AppStore = typeof store;
|
||||
export type AppDispatch = typeof store.dispatch;
|
||||
|
Reference in New Issue
Block a user