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

    Function moduleMaker

    • Builds a lazy-module maker for a capability, with the tag and default module name baked in so the maker takes only a loader in the common case. Capability owners export makers so consumers author modules without restating the spec.

      defaults.activatesOn sets the family's default demand gate: modules made by the maker are event-mode on it unless the call site declares its own activatesOn. This is how a capability owner makes the well-behaved activation the default for every provider (e.g. operation handlers park until an operation is invoked) — startup is not assumed.

      defaults.environments does the same for the runtime axis: a family declares the conditions its modules load under once here (every runtime for schema and operation handlers, browser and tauri for UI) rather than making each plugin repeat them. The call site's own environments still wins.

      Type Parameters

      Parameters

      • defaultName: string
      • capability: C
      • Optionaldefaults: { activatesOn?: Events; environments?: readonly string[] }

      Returns <
          Props = void,
          Options = Props,
          const Requires extends readonly AnyTag[] = readonly [],
          const Extra extends readonly AnyTag[] = readonly [],
      >(
          loader: LoadModule<Props, Requires, readonly [C, Extra]>,
          options?: MakerOptions<Requires, Extra, Props, Options>,
      ) => Module<Options>