Interface Module<TProps>

An object that represents a part of your domain. It contains business logic related to its particular job.

Type parameters

  • TProps

Index

Properties

sandbox

sandbox: Sandbox

The sandbox instance that serves the module.

Methods

destroy

  • destroy(): void
  • A lifecycle hook that is called when something stops the module.

    Returns void

init

  • init(props?: TProps): void
  • A lifecycle hook that is called when something starts the module.

    Parameters

    • Optional props: TProps

    Returns void

Optional moduleDidReceiveMessage

  • moduleDidReceiveMessage(message: Message): void
  • A lifecycle hook that is called when the module receives a message.

    Parameters

    Returns void

Optional moduleDidReceiveProps

  • moduleDidReceiveProps(nextProps: TProps): void
  • A lifecycle hook that is called when the module has already been started and something tries to start it again.

    Parameters

    • nextProps: TProps

    Returns void

Optional moduleWillSubscribe

  • moduleWillSubscribe(): string[]
  • A lifecycle hook that determines what messages the module should subscribe for.

    Returns string[]