react-code-dataset / wp-calypso /client /state /data-layer /wpcom /sites /memberships /subscriptions /index.js
react-code-dataset / wp-calypso /client /state /data-layer /wpcom /sites /memberships /subscriptions /index.js
Download wp-calypso/client/state/data-layer/wpcom/sites/memberships/subscriptions/index.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 882 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/data-layer/wpcom/sites/memberships/subscriptions/index.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/state/data-layer/wpcom/sites/memberships/subscriptions/index.js
-
curl -L -o index.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/data-layer/wpcom/sites/memberships/subscriptions/index.js
882 Bytes
| import { | |
| MEMBERSHIPS_SUBSCRIPTIONS_LIST_REQUEST, | |
| MEMBERSHIPS_SUBSCRIPTIONS_RECEIVE, | |
| } from 'calypso/state/action-types'; | |
| import { registerHandlers } from 'calypso/state/data-layer/handler-registry'; | |
| import { http } from 'calypso/state/data-layer/wpcom-http/actions'; | |
| import { dispatchRequest } from 'calypso/state/data-layer/wpcom-http/utils'; | |
| const noop = () => {}; | |
| export const handleSubscribedMembershipsList = dispatchRequest( { | |
| fetch: ( action ) => | |
| http( | |
| { | |
| method: 'GET', | |
| path: '/me/memberships/subscriptions', | |
| }, | |
| action | |
| ), | |
| onSuccess: ( action, { subscriptions, total } ) => ( { | |
| type: MEMBERSHIPS_SUBSCRIPTIONS_RECEIVE, | |
| subscriptions, | |
| total, | |
| } ), | |
| onError: noop, | |
| } ); | |
| registerHandlers( 'state/data-layer/wpcom/sites/memberships/subscriptions/index.js', { | |
| [ MEMBERSHIPS_SUBSCRIPTIONS_LIST_REQUEST ]: [ handleSubscribedMembershipsList ], | |
| } ); | |