Created
January 29, 2022 03:11
-
-
Save ksakae1216/0d6e15ebb3e6436520d66ffba1a2fc91 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createAction, props } from '@ngrx/store'; | |
// ログインするときのactionです、ログインID、パスワードをactionの引数に持ちたい時の書き方 | |
// '[Login] Do Login'は、'[どの画面]どんな処理'のようなイメージです | |
export const doLogin = createAction( | |
'[Login] Do Login', | |
props<{ loginId: string, password: string }>() | |
); | |
// storeのisLoginを更新したい時。更新したい値を引数にする | |
export const setLoginStateSuccess = createAction( | |
'[Login] Set Login State Success', | |
props<{ isLogin: boolean}>() | |
); | |
// こちらもstoreのerrorMessageを更新 | |
export const setErrorMessage = createAction( | |
'[Login] Set ErrorMessage', | |
props<{ errorMessage: string }>() | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment