Home > @xoram/core > defineAsyncPlugin
defineAsyncPlugin() function
Load a set of plugins in the application when a condition is met
Signature:
typescript
export declare function defineAsyncPlugin(importer: (app: Application) => Promise<OneOrMore<PluginDefinition>>, when: (app: Application) => Promise<void>, dependencies?: PluginId[]): PluginDefinition;
1
Parameters
Parameter | Type | Description |
---|---|---|
importer | (app: Application) => Promise<OneOrMore<PluginDefinition>> | a function to load the plugins asynchronously |
when | (app: Application) => Promise<void> | the condition to await |
dependencies | PluginId[] | (Optional) a list of plugins that the condition depends on |
Returns:
a plugin to set up the condition and load the plugin when it is met