Spaces:
Sleeping
Sleeping
pythonic-rag-FastAPIReact / frontend /node_modules /@pmmmwh /react-refresh-webpack-plugin /sockets /WHMEventSource.js
Download frontend/node_modules/@pmmmwh/react-refresh-webpack-plugin/sockets/WHMEventSource.js from sepidnes/pythonic-rag-FastAPIReact: direct link, hf CLI and curl.
- Browser
- Download file 876 Bytes
-
https://huggingface.co/spaces/sepidnes/pythonic-rag-FastAPIReact/resolve/c9f908872ebbec3c4fa1392419c0f6cd3750ddb3/frontend/node_modules/%40pmmmwh/react-refresh-webpack-plugin/sockets/WHMEventSource.js
- Command line
-
hf download hf://spaces/sepidnes/pythonic-rag-FastAPIReact@c9f908872ebbec3c4fa1392419c0f6cd3750ddb3/frontend/node_modules/@pmmmwh/react-refresh-webpack-plugin/sockets/WHMEventSource.js
-
curl -L -o WHMEventSource.js https://huggingface.co/spaces/sepidnes/pythonic-rag-FastAPIReact/resolve/c9f908872ebbec3c4fa1392419c0f6cd3750ddb3/frontend/node_modules/%40pmmmwh/react-refresh-webpack-plugin/sockets/WHMEventSource.js
876 Bytes
| /** | |
| * The hard-coded singleton key for webpack-hot-middleware's client instance. | |
| * | |
| * [Ref](https://github.com/webpack-contrib/webpack-hot-middleware/blob/cb29abb9dde435a1ac8e9b19f82d7d36b1093198/client.js#L152) | |
| */ | |
| const singletonKey = '__webpack_hot_middleware_reporter__'; | |
| /** | |
| * Initializes a socket server for HMR for webpack-hot-middleware. | |
| * @param {function(*): void} messageHandler A handler to consume Webpack compilation messages. | |
| * @returns {void} | |
| */ | |
| function initWHMEventSource(messageHandler) { | |
| const client = window[singletonKey]; | |
| client.useCustomOverlay({ | |
| showProblems: function showProblems(type, data) { | |
| const error = { | |
| data: data, | |
| type: type, | |
| }; | |
| messageHandler(error); | |
| }, | |
| clear: function clear() { | |
| messageHandler({ type: 'ok' }); | |
| }, | |
| }); | |
| } | |
| module.exports = { init: initWHMEventSource }; | |