Skip to content

ModuleDefinition interface

Home > @rimitive/core > ModuleDefinition

Input type for defineModule - same as Module but without status and with optional dependencies.

Signature:

export interface ModuleDefinition<TName extends string, TImpl, TDeps>

Property

Modifiers

Type

Description

dependencies?

AnyModule[]

(Optional) Modules this module depends on (resolved by compose)

name

TName

Unique name - becomes the property name on the composed context

Method

Description

create(deps)

Create the implementation with resolved dependencies

destroy(ctx)?

(Optional) Optional: called when context is disposed

init(ctx)?

(Optional) Optional: called when module is added to context

instrument(impl, instrumentation, ctx)?

(Optional) Optional: wrap impl for debugging/profiling when instrumentation is enabled