Closed avalanche1 closed 4 years ago
src/store.ts export RootDispatch
:
// src/store.ts
import { createStore, IcestoreRootState, IcestoreDispatch } from '@ice/store';
import models from './models';
const store = createStore(models);
export default store;
export type Models = typeof models;
export type Store = typeof store;
export type RootDispatch = IcestoreDispatch<Models>;
export type RootState = IcestoreRootState<Models>;
// models/todo.ts
import { RootDispatch } from '../store';
And we will update the docs.
@alvinhui
you must add interface to avoid recursive type checking.
How can I type annotate
dispatch
here?:icestore
doesnt exportRootDispatch
type.