This is used internally when creating index resources.
Optional
configOptional validation schema for runtime config validation. When provided, resource config will be validated when .with() is called.
Optional
contextCreate a private, mutable context shared between init
and dispose
.
Optional
dependenciesStatic or lazy dependency map. Receives config
when provided.
Optional
disposeClean-up function for the resource. This is called when the resource is no longer needed.
The value of the resource (undefined if no init method)
The configuration it received
The dependencies it needed
Promise
Stable identifier.
Optional
initInitialize and return the resource value. Called once during boot.
Optional
metaMiddleware applied around init/dispose.
Return an optional dependency wrapper for this resource.
Safe overrides to swap behavior while preserving identities. See README: Overrides.
Register other registerables (resources/tasks/middleware/events). Accepts a
static array or a function of config
to support dynamic wiring.
Optional
resultOptional validation schema for the resource's resolved value.
When provided, the value will be validated immediately after init
resolves,
without considering middleware.
This is optional and used from an index resource to get the correct caller. This is the reason we allow it here as well.