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
Fixes#80
This change fixes reactivity when using Provide/Inject. This previously
didn't work, because we froze the provided value at `provide()`
invocation time by just accessing `sample[name]`.
This change automagically wraps any provided values in a `computed()`
wrapper, which should update downstream injected values whenever the
provider changes.
This does two things of note:
1. It uses the Vue.js `computed()` function as demonstrated in the
[docs][1]
2. It wraps *any* provided value in `computed()`, including `data`,
which removes the need for the extra getter demonstrated in the
docs, but is a departure from the "standard" Vue component Options
API
Note that to use this now requires setting `unwrapInjectedRef: true`.
[1]: https://vuejs.org/guide/components/provide-inject.html#working-with-reactivity
0 commit comments