Closed coffee-cup closed 4 years ago
After adding the devtools as a plugin to my project, the type of State is any.
State
If I have
export const model = createModel<State>(); export const { state } = model.ctx;
the type of state is State.
state
However, if I then have
export const model = createModel<State>().with(devtoolsPlugin); export const { state } = model.ctx;
the type of state is any.
any
I assume this is because the devtools plugin is defined as
const plugin = createPlugin< DevToolsConfig, DevToolsUniverse, { state: any }, {} >("devtools");
where the ActionCtx type is any. This any for state is being merged with the user defined State type.
ActionCtx
After adding the devtools as a plugin to my project, the type of
State
is any.If I have
the type of
state
isState
.However, if I then have
the type of
state
isany
.I assume this is because the devtools plugin is defined as
where the
ActionCtx
type isany
. Thisany
for state is being merged with the user definedState
type.