-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3742 from marmelab/discriminated-union-type-for-a…
…uth-action [RFR] Discriminated union type for auth action
- Loading branch information
Showing
2 changed files
with
13 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
import { AuthActionType } from '../types'; | ||
|
||
export type UserCheck = ( | ||
payload: object, | ||
pathName: string, | ||
routeParams?: object | ||
) => void; | ||
|
||
export const AUTH_LOGIN: AuthActionType = 'AUTH_LOGIN'; | ||
export const AUTH_CHECK: AuthActionType = 'AUTH_CHECK'; | ||
export const AUTH_ERROR: AuthActionType = 'AUTH_ERROR'; | ||
export const AUTH_LOGOUT: AuthActionType = 'AUTH_LOGOUT'; | ||
export const AUTH_GET_PERMISSIONS: AuthActionType = 'AUTH_GET_PERMISSIONS'; | ||
export const AUTH_LOGIN = 'AUTH_LOGIN'; | ||
export const AUTH_CHECK = 'AUTH_CHECK'; | ||
export const AUTH_ERROR = 'AUTH_ERROR'; | ||
export const AUTH_LOGOUT = 'AUTH_LOGOUT'; | ||
export const AUTH_GET_PERMISSIONS = 'AUTH_GET_PERMISSIONS'; | ||
|
||
export type AuthActionType = | ||
| typeof AUTH_LOGIN | ||
| typeof AUTH_LOGOUT | ||
| typeof AUTH_ERROR | ||
| typeof AUTH_CHECK | ||
| typeof AUTH_GET_PERMISSIONS; |
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