@dxos/app-framework - v0.15.0
    Preparing search index...

    Function useSpaceCallback

    • Build a callback that runs an effect on the Capabilities.ProcessManagerRuntime with space-scoped services resolved via ServiceResolver.provide.

      Arguments passed to the returned callback are forwarded to fn, and the effect's result comes back as the callback's promise — rejecting with the effect's failure (E), with ServiceNotAvailableError when a tag cannot be resolved for the space, or with a TypeError when called while spaceId is still undefined.

      The tags tuple must list every service the effect requires (beyond the fixed Capabilities.ProcessManagerRuntimeServices); these services are resolved for the given spaceId through the runtime's service resolver.

      Nested Operation.invoke / Operation.schedule calls within the effect inherit spaceId as a default Operation.InvokeOptions so that spawned operation processes have a space context (and therefore can resolve space-scoped services like Database.Service) without each call site having to thread the id through manually.

      Type Parameters

      • const Tags extends readonly Key<any, any>[]
      • TArgs extends readonly unknown[]
      • T
      • E

      Parameters

      Returns (...args: TArgs) => Promise<T>