Readonly
changeNotifications of state change. Normally you just await construction but this offers more granular events and repeating events.
Readonly
closedResolves when destruction completes; rejects if the component crashes.
Handling errors on this promise will prevent other handlers from seeing the primary cause.
Optional
Readonly
errorIf construction ends with an error, the error is saved here.
Readonly
isTrue iff the primary error has been or will be reported.
Readonly
readyResolves when construction completes; rejects if construction crashes.
Behaves identically to Construction but always throws the primary cause rather than CrashedDependencyError.
Handling errors on this promise will prevent other handlers from seeing the primary cause.
Readonly
statusStatus of the constructed object.
Throws an error if construction is ongoing or incomplete.
Optional
description: stringAsserts construction is complete and that an object is defined.
Invoke destruction logic then move to destroyed status.
Typically you invoke this in the subject's "close" method.
Use of this function is optional. It provides these benefits:
Optional
destructor: (() => MaybePromise)Move subject to "crashed" state, optionally setting the cause.
This happens automatically if there is an error during construction. It is also useful for post-construction errors to convey crashed state to components such as the environmental runtime service.
Optional
cause: anyInvoke a method after construction completes unsuccessfully.
If you register an onError handler then the default error handler will not log the error.
Errors thrown by this callback are logged but otherwise ignored.
Invoke a method after construction completes successfully.
Errors thrown by this callback are logged but otherwise ignored.
Manually force a specific status.
This offers flexibility in component lifecycle management including resetting component to inactive state and broadcasting lifecycle changes. On reset listeners are also reset and must be reinstalled.
This method fails if initialization is ongoing; await completion first.
If you omit the initializer parameter to Construction execution is deferred until you invoke this method to initiate construction via the Constructable.Deferred interface.
Unlike the initializer, errors are always reported via the PromiseLike interface even if the constructable throws an error synchronously.
The promise implementing by an Constructable#construction.