Download wp-calypso/client/state/active-promotions/actions.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.24 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/active-promotions/actions.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/state/active-promotions/actions.js
-
curl -L -o actions.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/active-promotions/actions.js
1.24 kB
| import { | |
| ACTIVE_PROMOTIONS_RECEIVE, | |
| ACTIVE_PROMOTIONS_REQUEST, | |
| ACTIVE_PROMOTIONS_REQUEST_SUCCESS, | |
| ACTIVE_PROMOTIONS_REQUEST_FAILURE, | |
| } from 'calypso/state/action-types'; | |
| import 'calypso/state/data-layer/wpcom/active-promotions'; | |
| import 'calypso/state/active-promotions/init'; | |
| /** | |
| * Action creator function: RECEIVE | |
| * @param {Array} activePromotions - WordPress.com activePromotions list | |
| * @returns {Object} action object | |
| */ | |
| export function activePromotionsReceiveAction( activePromotions ) { | |
| return { | |
| type: ACTIVE_PROMOTIONS_RECEIVE, | |
| activePromotions, | |
| }; | |
| } | |
| /** | |
| * Action creator function: REQUEST_SUCCESS | |
| * @returns {Object} action object | |
| */ | |
| export function activePromotionsRequestSuccessAction() { | |
| return { type: ACTIVE_PROMOTIONS_REQUEST_SUCCESS }; | |
| } | |
| /** | |
| * Action creator function: REQUEST_FAILURE | |
| * @param {string} error - error message | |
| * @returns {Object} action object | |
| */ | |
| export function activePromotionsRequestFailureAction( error ) { | |
| return { | |
| type: ACTIVE_PROMOTIONS_REQUEST_FAILURE, | |
| error: error, | |
| }; | |
| } | |
| /** | |
| * Action creator to request WordPress.com activePromotions: REQUEST | |
| * @returns {Object} action object | |
| */ | |
| export const requestActivePromotions = () => ( { type: ACTIVE_PROMOTIONS_REQUEST } ); | |