feat: enable subscription connections in web and dev

This commit is contained in:
amosblomqvist
2026-10-26 03:00:40 +02:00
parent fc3673466d
commit c0c670b810
29 changed files with 838 additions and 41 deletions
+3
View File
@@ -116,6 +116,9 @@ export function wireSource(source: NotifySource, hub: ReturnType<typeof createNo
const EventsContext = createContext<ReturnType<typeof createNotifyHub> | null>(null);
/** Transport adapters may also be mounted in isolation with an injected bridge. */
export function useNotifyHub() { return useContext(EventsContext); }
export function ServerEventsProvider({ children, connect }: { children: ReactNode; connect?: () => NotifySource }) {
const hub = useMemo(() => createNotifyHub(), []);
useEffect(() => wireSource((connect ?? openEventsChannel)(), hub), [hub, connect]);