-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Description
What problem does this feature solve?
Currently when an inject
fails to resolve, nothing happens, and the injected value just remains untouched. This seems like an opportunity to warn the developer that an inject
could not be resolved.
Perhaps this is intended behavior. Maybe it makes sense that sometimes an injection would not be resolved. If that is the case, could there be a way to indicate a given inject is required? A stricter injection method?
My current workaround is to throw an error if the object is undefined as of create
(since injects are resolved by then), but it's a manual step that must be made in many places.
What does the proposed API look like?
If a new API is needed to support this, I am not sure how to design it.
As for warning, I was hoping that when an inject
could not be resolved, there would be a warning in the browser console.