feat: nested collections (#680)

This commit is contained in:
Daniel Lautzenheiser
2023-04-04 15:12:32 -04:00
committed by GitHub
parent 22a1b8d9c0
commit d0ecae310c
54 changed files with 2671 additions and 295 deletions

View File

@ -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;