Download wp-calypso/client/state/console-dispatch/index.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 798 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/console-dispatch/index.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/state/console-dispatch/index.js
-
curl -L -o index.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/console-dispatch/index.js
798 Bytes
| /** | |
| * Console dispatcher Redux store enhancer | |
| * | |
| * Inject at the top of the `createStore` enhancer chain | |
| * to provide access to actionTypes and store methods directly | |
| * from the console. | |
| * | |
| * Will only attach if the `window` variable is available | |
| * globally. If not it will simply be an empty link in the | |
| * chain, passing straight through. | |
| * @param {Function} next next store enhancer in chain | |
| * @returns {Function} console dispatcher store enhancer | |
| */ | |
| export const consoleDispatcher = | |
| ( next ) => | |
| ( ...args ) => { | |
| const store = next( ...args ); | |
| if ( 'undefined' !== typeof window ) { | |
| Object.assign( window, store ); | |
| Object.defineProperty( window, 'state', { | |
| enumerable: true, | |
| get: store.getState, | |
| } ); | |
| } | |
| return store; | |
| }; | |
| export default consoleDispatcher; | |