-
Notifications
You must be signed in to change notification settings - Fork 96
Nick/lesson18 #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nick/lesson18 #39
Conversation
src/components/Login/saga.ts
Outdated
| yield call(logout); | ||
| } | ||
|
|
||
| export function* saveUserSession(action: PayloadAction<string>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vvscode @saitonakamura
Плиз, подскажите, как сделать так, чтобы не типизировать action: PayloadAction<string>?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nickovchinnikov никак ))тебе же нужно задать тип переменной
ты это можешь сделать или через тип переменной, который ты отдельно объявишь, или так
ну можешь ReturnType<typeof actions.saveUser>
|
|
||
| export function* loginSaga() { | ||
| yield fork(checkUserSession); | ||
| yield takeEvery(actions.login.type, saveUserSession); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
К вопросу выше, не может это как то сменеджиться тут?
yield takeEvery(actions.login.type, saveUserSession);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не понял вопрос )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://redux-saga.js.org/docs/api/#takeeverypattern-saga-args
takeEvery вызывает saveUserSession с подпиской на событие
Вот и подумал, вдруг есть возможность сделать вызов с матчингом сигнатуры вот тут
#39 (comment)
Fix action type in saga
StandartGame refactoring Field fix
No description provided.