Options
All
  • Public
  • Public/Protected
  • All
Menu
label

COMMON

description

Singleton class that serves as a helper to aggregate and dynamically configure nest module imports. A differentiation is done around scoped- and scheduler imports. In fact, the configuration of the dApp may enable (opt-in) specific scopes and schedulers.

since

v0.1.0

Hierarchy

  • ScopeFactory

Index

Constructors

  • Constructs an imports factory around a DappConfig configuration object. The resulting imports differ depending on the scopes field in the configuration as well as the scheduler field, for cronjobs.

    Note that this constructor is private to prevent the instanciation of multiple instances of this class. Use the ScopeFactory.create method to create the instance once.

    access

    protected

    Parameters

    • dappConfig: DappConfig

      An instance of DappConfig that will be used to initialize {@link ConfigModule}.

    Returns ScopeFactory

Properties

baseImports: AbstractAppModule[] = []

The imports that are always returned. This includes currently only the ConfigModule that is available with nest. The module is automatically initialized with the DappConfig object.

Base imports consist in imports that are used with both types of processes: scoped modules and scheduler modules.

access

private

var

{AbstractAppModule[]}

$_INSTANCE: ScopeFactory = null

The singleton instance. This instance is created once per process and will be re-used afterwards.

access

protected

static
var

{ScopeFactory}

Methods

  • Returns an array of nest AbstractAppModule that are enabled (opt-in) through the dApp configuration with the field named scopes (config/dapp.json).

    i.e. if you enable the discovery scope by setting "scopes": ["discovery"] in your config/dapp.json, this method will return the DiscoveryModule.

    Note that this method returns only Scopes modules.

    static

    Returns AbstractAppModule[]

    A list of dynamic modules that are enabled as modules.

  • Returns an array of nest AbstractAppModule that are enabled (opt-in) through the dApp configuration with the field named scopes (config/dapp.json). This method returns all cronjobs (schedulers / commands) that must be registered for a given scope.

    i.e. if you enable the discovery scope by setting "scopes": ["discovery"] in your config/dapp.json, this method will register the DiscoveryAccountsModule and the DiscoverAccountsCommand.

    Note that this method returns only Schedulers modules.

    static

    Returns AbstractAppModule[]

    A list of dynamic modules that are enabled as schedulers.

  • Creates an imports factory around a DappConfig configuration object. This class is intended to be used with the singleton pattern and thereby authorizes the creation of only one class instance per running process.

    access

    public

    static

    Parameters

    Returns ScopeFactory

    The singleton instance of the class configured around a DappConfig.

Generated using TypeDoc