Download components/slices/websocketSlice.js from TigerTrading/dockfire-reactify-web: direct link, hf CLI and curl.
- Browser
- Download file 697 Bytes
-
https://huggingface.co/spaces/TigerTrading/dockfire-reactify-web/resolve/main/components/slices/websocketSlice.js
- Command line
-
hf download hf://spaces/TigerTrading/dockfire-reactify-web/components/slices/websocketSlice.js
-
curl -L -o websocketSlice.js https://huggingface.co/spaces/TigerTrading/dockfire-reactify-web/resolve/main/components/slices/websocketSlice.js
697 Bytes
| import { createSlice } from '@reduxjs/toolkit'; | |
| const initialState = { | |
| connected: false, | |
| latency: 23, | |
| subscriptions: ['system-metrics', 'ai-status', 'notifications'], | |
| lastUpdate: new Date().toISOString() | |
| }; | |
| export const websocketSlice = createSlice({ | |
| name: 'websocket', | |
| initialState, | |
| reducers: { | |
| websocketConnected: (state) => { | |
| state.connected = true; | |
| }, | |
| websocketDisconnected: (state) => { | |
| state.connected = false; | |
| }, | |
| updateLatency: (state, action) => { | |
| state.latency = action.payload; | |
| }, | |
| }, | |
| }); | |
| export const { websocketConnected, websocketDisconnected, updateLatency } = websocketSlice.actions; | |
| export default websocketSlice.reducer; |