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

feature request: make setConvexClientContext public #5

Closed
NotWoods opened this issue Jul 13, 2024 · 4 comments · Fixed by #16
Closed

feature request: make setConvexClientContext public #5

NotWoods opened this issue Jul 13, 2024 · 4 comments · Fixed by #16

Comments

@NotWoods
Copy link

For SvelteKit, I want to be able to share a Convex Client between load functions and my .svelte files. This is possible in convex-react/Remix because the client is created separately then passed to ConvexClientProvider.

setConvexClientContext is the nearest equivalent in Svelte land and it's already present in the client file. It would be great if the function was exported too!

@keithkelly31
Copy link

@NotWoods Do you want to share the client between server load functions (+page.server.ts) or browser load functions (+page.ts)?

@NotWoods
Copy link
Author

I'm looking to share it between client load function (+page.ts) and .svelte files

@thomasballinger
Copy link
Collaborator

You got it! Is there you want here @NotWoods? Or should setupConvex take a client as an argument, and not close in a cleanup effect if it was passed in?

@thomasballinger
Copy link
Collaborator

done in #16, @NotWoods lmk if there's a different API you'd prefer

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 a pull request may close this issue.

3 participants