Skip to main content

externalInitialisable

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

Methods

externalinitialise

  • initialise(): void | Promise<void>

externalisInitialised

  • 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