-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(app): app.runWithContext() #7451
Conversation
I also think it's worth giving functions like the callback passed to |
b137661
to
ae26bff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would also be greatly helpful for Nuxt and VueUse as well 👍
Allows accessing globals provided at the app level with `app.provide()` via a regular `inject()` call as long as you have access to the application. Useful for Pinia, vue-router, Nuxt, Quasar, and other advanced use cases. - vuejs/pinia#1784
ae26bff
to
afed3c3
Compare
This feature requires Vue 3.3.0, which has been out for a while now. It allows using vue-query APIs in places where it is valid to use them but currently throws an error. - `hasInjectionContext()`: vuejs/core#8111 - `app.runWithContext()`: vuejs/core#7451
This feature requires Vue 3.3.0, which has been out for a while now. It allows using vue-query APIs in places where it is valid to use them but currently throws an error. - `hasInjectionContext()`: vuejs/core#8111 - `app.runWithContext()`: vuejs/core#7451
This feature requires Vue 3.3.0, which has been out for a while now. It allows using vue-query APIs in places where it is valid to use them but currently throws an error. - `hasInjectionContext()`: vuejs/core#8111 - `app.runWithContext()`: vuejs/core#7451
* feat(vue-query): support injectable contexts This feature requires Vue 3.3.0, which has been out for a while now. It allows using vue-query APIs in places where it is valid to use them but currently throws an error. - `hasInjectionContext()`: vuejs/core#8111 - `app.runWithContext()`: vuejs/core#7451 * refactor: add dev warning for effectScope * fix: add memory leak warnings, fix tests * chore: bump vue-demi * chore: bump vue version in integrations --------- Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com>
Allows accessing globals provided at the app level with
app.provide()
via a regularinject()
call as long as you have access to the application. Useful for Pinia, vue-router, Nuxt, Quasar, VueUse, and other advanced use cases.I named the function
runWithContext()
to look likeeffect.run()
but maybe it should be named something different likerunWithProvides()
since it only ensuresinject()
behavior but I think keeping a more generic names allows to add other things if the future likeonServerPrefetch()
and so.