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
Per https://codesandbox.io/s/entityadapter-test-o5190 , savedQueriesSliceScoped.ts has a state slice with two different normalized sections inside of it: {public: EntityState, private: EntityState}.
That means that passing someAdapter.updateMany as a case reducer should be illegal and cause a TS error, because the adapter methods should only be getting an EntityState object as the state argument. Instead, TS doesn't seem to error.
If I manually write a reducer and call that same update method inside, TS correctly flags it as being illegal:
const{ actions, reducer }=createSlice({name: "savedQueriesScoped",initialState: initialSavedQueriesState,reducers: {// This line should cause errors, but doesn'tsavedQueriesUpdated: savedQueriesAdapter.updateMany,otherReducer(state,action: PayloadAction<KustoQueryDefinition[]>){// the `state` arg here will be flagged as an errorsavedQueriesAdapter.updateMany(state,action);}},
Per https://codesandbox.io/s/entityadapter-test-o5190 ,
savedQueriesSliceScoped.ts
has a state slice with two different normalized sections inside of it:{public: EntityState, private: EntityState}
.That means that passing
someAdapter.updateMany
as a case reducer should be illegal and cause a TS error, because the adapter methods should only be getting anEntityState
object as thestate
argument. Instead, TS doesn't seem to error.If I manually write a reducer and call that same update method inside, TS correctly flags it as being illegal:
@phryneas , any ideas?
The text was updated successfully, but these errors were encountered: