-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Closed
Description
What problem does this feature solve?
I am using provide/inject as component store and want to provide some value if it is not already provided by parent component, e.g.:
let v = inject(key)
if (!v) {
provide(key, value)
}
It works well except that on first invocation there is a warning that injection not found.
What does the proposed API look like?
Remove the warning or provide some way to silence it or "declare" injection value without overriding existing one, e.g.:
inject(key, undefined) // undefined means set value if it does not already exist
KaelWD, CyberAP, carnival187, medairbit, goliafrs and 3 more
Metadata
Metadata
Assignees
Labels
No labels