Records every register/registerFactory call, in order.
Exposed as a ReadonlyArray so a test can assert against the recording
without being able to rewrite it; #record is the mutable backing store.
Resolves a service by capability token.
On a multi-provider token this returns the FIRST registered provider; use
IServiceRegistry.getAll to reach all of them.
The expected service type
The capability token to resolve
The registered service
Resolves every provider registered for a multi-provider token.
The expected service type
The capability token to resolve
All registered providers, in registration order; empty when none
Reports whether a capability is available.
The capability token to look up
true if at least one provider is registered
Registers a service instance under a capability token.
The service type
The capability token to register under
The service instance
Optionaloptions: RegisterOptions
Override and multi-provider behavior
Registers a lazy factory: the service is instantiated on first
get and cached for subsequent lookups.
The service type
The capability token to register under
Factory invoked once, on first lookup
Optionaloptions: RegisterOptions
Override and multi-provider behavior
Removes a registration. On a multi-provider token this removes EVERY provider registered under it, not just the first.
The capability token to remove
true if a registration was removed
In-memory
IServiceRegistrywith registration recording.Reproduces the kernel
ServiceRegistry's observable semantics field-for-field, because a double that diverges hides the bug it exists to catch:getresolves a factory once and caches it; on a miss throws the kernel's verbatim two-sentence message.getAllreturns[...(single ? [single] : []), ...multi]— the single registration is included, not just the multi list.register/registerFactoryhonorRegisterOptionsexactly:multi: trueappends; otherwise a second registration throws unlessoverride: truereplaces it.haschecks both maps;unregisterdeletes from both.registrationsfield records every call.Since
0.1.0