You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to #634 and the issue described and fixed in #790, users of easy-peasy were unable to define their own aliases of the Action, Computed, and Thunk types. The same is true for Unstable_EffectOn, e.g.
typeAppEffectOn<TModelextendsobject>=Unstable_EffectOn<TModel,StoreModel,Injections>;interfaceStoreModel{todos: TodosModel;rootData: number;}interfaceTodosModel{items: {id: number;text: string}[];foo: string;setFoo: Action<TodosModel,string>;onStateChanged: AppEffectOn<TodosModel>;}consttodosModel: TodosModel={// ...onStateChanged: unstable_effectOn([(state)=>state.items,// error! Property 'items' does not exist on type 'StateMapper<FilterActionTypes<{}>>'(state,storeState)=>storeState.rootData,// error!],(actions,change,helpers)=>{actions.setFoo('bar');// error! Property 'setFoo' does not exist on type 'Actions<{}>'helpers.dispatch.todos.setFoo('plop');// error!helpers.getState().items[0].id+2;// error!return()=>console.log('dispose');},),};Sincethegenerictypeparamsofthetypearenotactuallyused,TypeScript"forgets"themwhenthetypeisaliased.ThefixshouldbestraightforwardwhichIcanspinupaPRforshortly.
The text was updated successfully, but these errors were encountered:
Similar to #634 and the issue described and fixed in #790, users of easy-peasy were unable to define their own aliases of the
Action
,Computed
, andThunk
types. The same is true forUnstable_EffectOn
, e.g.The text was updated successfully, but these errors were encountered: