mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-10 02:29:19 +03:00
clean up
This commit is contained in:
parent
d2b0878704
commit
7ebc58a63f
@ -205,13 +205,7 @@ function applyCameraActivity(payload: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// Hooks
|
// Hooks
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the send function for publishing WS messages.
|
|
||||||
*/
|
|
||||||
export function useWsUpdate(): WsSend {
|
export function useWsUpdate(): WsSend {
|
||||||
const send = useContext(WsSendContext);
|
const send = useContext(WsSendContext);
|
||||||
if (!send) {
|
if (!send) {
|
||||||
@ -220,12 +214,10 @@ export function useWsUpdate(): WsSend {
|
|||||||
return send;
|
return send;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// Subscribe to a single WS topic with proper bail-out.
|
||||||
* Subscribe to a single WS topic with proper bail-out.
|
// Only re-renders when the topic's value changes (Object.is comparison).
|
||||||
* Only re-renders when the topic's value changes (Object.is comparison).
|
// Uses useSyncExternalStore — zero useEffect, so no PassiveMask flags
|
||||||
* Uses useSyncExternalStore — zero useEffect, so no PassiveMask flags
|
// propagate through the fiber tree.
|
||||||
* propagate through the fiber tree.
|
|
||||||
*/
|
|
||||||
export function useWs(watchTopic: string, publishTopic: string) {
|
export function useWs(watchTopic: string, publishTopic: string) {
|
||||||
const payload = useSyncExternalStore(
|
const payload = useSyncExternalStore(
|
||||||
useCallback(
|
useCallback(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user