Download wp-calypso/packages/data-stores/src/user/actions.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 672 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/data-stores/src/user/actions.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/packages/data-stores/src/user/actions.ts
-
curl -L -o actions.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/data-stores/src/user/actions.ts
672 Bytes
| import type { CurrentUser } from './types'; | |
| export function createActions() { | |
| const receiveCurrentUser = ( currentUser: CurrentUser ) => ( { | |
| type: 'RECEIVE_CURRENT_USER' as const, | |
| currentUser, | |
| } ); | |
| const receiveCurrentUserFailed = () => ( { | |
| type: 'RECEIVE_CURRENT_USER_FAILED' as const, | |
| } ); | |
| return { | |
| receiveCurrentUser, | |
| receiveCurrentUserFailed, | |
| }; | |
| } | |
| export type ActionCreators = ReturnType< typeof createActions >; | |
| export type Action = | |
| | ReturnType< | |
| ActionCreators[ 'receiveCurrentUser' ] | ActionCreators[ 'receiveCurrentUserFailed' ] | |
| > | |
| // Type added so we can dispatch actions in tests, but has no runtime cost | |
| | { type: 'TEST_ACTION' }; | |