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(nuxt): tryUseNuxtApp
composable
#25031
Conversation
Run & review this pull request in StackBlitz Codeflow. |
β Live Preview ready!
|
Nice work. |
Makes sense :D Co-authored-by: Daniel Roe <daniel@roe.dev>
Co-authored-by: Damian GΕowala <damian.glowala.rebkow@gmail.com>
Hi guys, just curious: Was this meant for modules and integrations? I think nuxt storybook temporarily throws this exception when booting up, and seems like this would help |
Yo. I was using this for composables that can be run in modules/plugins/components/async context. This meant to be used whenever dev is OK that he could not have context currently and have alternative to use instead. I dont know about Storybook issue, but if it needs that context, tryUseNuxtApp wouldn't help much. |
π Linked issue
#24681
β Type of change
π Description
This PR adds new
tryUseNuxtApp
alias foruseNuxtApp
which will returnnull
instead of throwing an exception. This also matches with existingtryUseNuxt
composable.Resolves #24681
I have also decided not to create separate page in docs for this one.
π Checklist