glimmerjs / glimmer-di

MIT License
41 stars 9 forks source link

Proposal: Track instance registrations separate from factory registrations #21

Open dgeb opened 7 years ago

dgeb commented 7 years ago

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:

dgeb commented 7 years ago

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.