Skip to content
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

[WIP] composition API example #337

Draft
wants to merge 2 commits into
base: v4
Choose a base branch
from
Draft

Conversation

kazazes
Copy link
Contributor

@kazazes kazazes commented Jun 9, 2020

Addresses #288.

Signed-off-by: Peter Kazazes <peter@peterk.co>
Signed-off-by: Peter Kazazes <peter@peterk.co>
app.setup = () => {
const clients = reactive(app.apolloProvider?.clients);
provide(DefaultApolloClient, clients?.defaultClient);
return { [ApolloClients]: clients }; // not req'd but need to return data
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This functionally does nothing, but is required to conform to app.setup's typings.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still uncomfortable with assigning app.setup = () => { ... } in a plugin as this will break as soon as another plugin tries to do the same thing.

See this issue in the nuxt-composition-api repository for a discussion on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants