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

    Class PluginContext

    Facilitates the dependency injection between plugin modules by allowing them contribute and request capabilities from each other. It tracks the capabilities that are contributed in an in-memory live object. This allows the application to subscribe to this state and incorporate plugins which are added dynamically.

    Index

    Constructors

    Properties

    _capabilities: (arg: string) => Atom = ...
    _capability: (arg: string) => Atom = ...
    activate: (event: ActivationEvent) => Effect<boolean, Error>

    Activates plugins based on the activation event.

    Type declaration

      • (event: ActivationEvent): Effect<boolean, Error>
      • Parameters

        Returns Effect<boolean, Error>

        Whether the activation was successful.

    reset: (event: ActivationEvent) => Effect<boolean, Error>

    Re-activates the modules that were activated by the event.

    Type declaration

      • (event: ActivationEvent): Effect<boolean, Error>
      • Parameters

        Returns Effect<boolean, Error>

        Whether the reset was successful.

    Methods

    • Get the Atom reference to the available capabilities for a given interface. Primarily useful for deriving other Atom values based on the capabilities or for subscribing to changes in the capabilities.

      Type Parameters

      • T

      Parameters

      Returns Atom<T[]>

      An atom reference to the available capabilities.

    • Get the Atom reference to the available capabilities for a given interface. Primarily useful for deriving other Atom values based on the capability or for subscribing to changes in the capability.

      Type Parameters

      • T

      Parameters

      Returns Atom<T>

      An atom reference to the available capability.

      If no capability is found.