You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a Registry, both factories and instances can be registered via register, unregistered via unregister, and accessed via registration.
@krisselden and I discussed the benefits of separating the interfaces to register factories and instances. This change will provide stronger typing for storing and accessing factories and instances.
This would entail the following changes:
Change Registry#register to accept a more strongly typed FactoryDefinition<any>
I just tweaked the description of this issue, which originally mentioned a simplification for registration options. However, I realized that this was an oversimplification since we still need to register options (like singleton: false) by type.
In a
Registry
, both factories and instances can be registered viaregister
, unregistered viaunregister
, and accessed viaregistration
.@krisselden and I discussed the benefits of separating the interfaces to register factories and instances. This change will provide stronger typing for storing and accessing factories and instances.
This would entail the following changes:
Registry#register
to accept a more strongly typedFactoryDefinition<any>
Registry
:registerInstance(specifier: string, instance: any): void
unregisterInstance(specifier: string): void
registeredInstance(specifier: string): any
Container#lookup
, check the registry'sregisteredInstance
as a first step and return an instance if found.The text was updated successfully, but these errors were encountered: