Skip to main content

externalabstractInitialisable

An interface to be implemented by any Ability that needs to initialise the resources it uses, e.g. establish a database connection.

The Initialisable.initialise method is invoked whenever Actor.attemptsTo method is called, but only when Initialisable.isInitialised returns false. This is to avoid initialising abilities more than once.

Learn more

Index

Constructors

externalconstructor

Methods

staticexternalisInitialisable

  • Type parameters

    • T

    Parameters

    • externalvalue: T

    Returns value is T & Initialisable

externalabstractinitialise

  • initialise(): void | Promise<void>

externalabstractisInitialised

  • isInitialised(): boolean
  • Should return true when all the resources that the given ability needs have been initialised. Should return false if the Actor should initialise them again when Actor.attemptsTo is called.


    Returns boolean