-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Run hooks and props within the context of the vue app #448
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for kitbag-router ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
vueApp = app | ||
|
||
propStore.setVueApp(app) |
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.
I know this is overkill but thoughts on storing the vueApp in it's own "store"? That would solve 2 things I don't love about the current implementation.
- we use a
let
- the hooks and props technically have independent references and ideally they'd look in the same place
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.
that new "store" could also be responsible for exporting the runWithContext
piece
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.
Don't hate it, I'll look into that tomorrow.
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.
@stackoverfloweth looking at this again not sure how the new store would work. We don't really have a way for the propsStore to get something from a separate store. Maybe we can chat about this
Description
Since 3.3 vue has had a utility called runWithContext which allows for global injection to work within any callback. Using this when running hooks and props means that global injection also works within those callback.