Skip to main content

Initialisable

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

initialise

  • initialise(): void | Promise<void>

isInitialised

  • 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