#4 State management with Rematch - more models

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

Man i just found your channel, keep up good work. You got new Subscribed 👍

vzdev
Автор

A great course! Thank you for your effort.

lenakim
Автор

Type error: Type '((payload: User, meta: void) => void) & { isEffect: true; }' is not assignable to type '(user: User) => void'. TS2322

Hello lebedev, there is an error. Could you guide me please? Its also showing this error when i checkout your 04-second-model branch.

boonyaolee
Автор

Hello Sir, Thanks a lot for your hard work for making this tutorial. But unfortunately with @rematch/core at version 1.2.0 types are breaking I did clone your repo and tried a lot but under users.tsx -> I had to do this


const mapDispatch = (dispatch: RematchDispatch) => ({
load: dispatch.users.load,
toggleFollow: (user: User) =>
dispatch({ type: "users/toggleFollow", payload: user })
});


instead of


const mapDispatch = (dispatch: RematchDispatch) => ({
load: dispatch.users.load,
toggleFollow: dispatch.users.toggleFollow
});


Plus the biggest problem is not getting type safety under our effects, this is just not acceptable as it nullifies using typescript in the first place. We use typescript for type safety isn't it? I did read your hooks post with rematch thanks a lot for it but typesafe effects are what I am looking for. That is why I am giving a shot to easy-peasy.


Plus if you use hooks with rematch no autocompletion under useRematchDispatch.

arsalanshaikh