mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-07 03:35:26 +03:00
match context shape
This commit is contained in:
parent
a247571829
commit
d8127a5592
@ -5,7 +5,7 @@ import { useCallback, useContext, useEffect, useReducer } from 'preact/hooks';
|
|||||||
import useWebSocket, { ReadyState } from 'react-use-websocket';
|
import useWebSocket, { ReadyState } from 'react-use-websocket';
|
||||||
|
|
||||||
const initialState = Object.freeze({ __connected: false });
|
const initialState = Object.freeze({ __connected: false });
|
||||||
export const WS = createContext({ state: initialState, connection: null });
|
export const WS = createContext({ state: initialState, readyState: null, sendJsonMessage: () => {} });
|
||||||
|
|
||||||
function reducer(state, { topic, payload, retain }) {
|
function reducer(state, { topic, payload, retain }) {
|
||||||
switch (topic) {
|
switch (topic) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user