@honua/sdk-js
    Preparing search index...

    Function useRealtime

    • Open a realtime subscription for the lifetime of the component and tear it down on unmount (StrictMode-safe: the effect's cleanup runs between the double-invoked mounts, so no duplicate subscriptions leak).

      factory should open the subscription and return its cleanup handle. It is re-run whenever deps change. Works with the SDK realtime store (store.connect(...) returns { close() }) or any () => void unsubscribe.

      Parameters

      • factory: (() => RealtimeCleanup | undefined) | null | undefined
      • deps: readonly unknown[] = []

      Returns void

      useRealtime(() => store.connect(transport, request), [transport, request]);