1 | import createRematchStore from './rematchStore'
|
2 | import { InitConfig, Models, RematchStore, ModelCreator } from './types'
|
3 | import createConfig from './config'
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | export const init = <
|
9 | TModels extends Models<TModels>,
|
10 | TExtraModels extends Models<TModels> = Record<string, never>
|
11 | >(
|
12 | initConfig?: InitConfig<TModels, TExtraModels>
|
13 | ): RematchStore<TModels, TExtraModels> => {
|
14 | const config = createConfig(initConfig || {})
|
15 | return createRematchStore(config)
|
16 | }
|
17 |
|
18 | export const createModel: ModelCreator = () => (mo) => mo as any
|
19 |
|
20 | export default {
|
21 | init,
|
22 | createModel,
|
23 | }
|
24 |
|
25 | export * from './types'
|