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

feat: support passing custom fetch and listen functions #43

Merged
merged 4 commits into from
Jan 9, 2025

Conversation

bjoerge
Copy link
Member

@bjoerge bjoerge commented Jan 8, 2025

This refactors the listener creator functions so they can be used without a Sanity Client instance. Useful for cases where you might not have a dataset or a project id and thus doesn't make sense to create a client.

Since we're still on 0.x I took the liberty of doing a breaking change (I believe I'm the only one using these anyway):

createDocumentLoader is renamed to createDocumentLoaderFromClient
createSharedListener is renamed to createDocumentLoaderFromClient

Also included a couple of cleanups I found along the way

Will release as 0.12.0

BREAKING CHANGE:
`createDocumentLoader` is renamed to `createDocumentLoaderFromClient`
`createSharedListener` is renamed to `createDocumentLoaderFromClient`
Copy link

vercel bot commented Jan 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mutate-example-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 8, 2025 2:26pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
mutate-example-visual-editing ⬜️ Ignored (Inspect) Visit Preview Jan 8, 2025 2:26pm

Copy link

@ricokahler ricokahler left a comment

Choose a reason for hiding this comment

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

looks good!

@bjoerge bjoerge merged commit e3fdadd into main Jan 9, 2025
9 checks passed
@bjoerge bjoerge deleted the custom-fetch-and-listen branch January 9, 2025 08:42
bjoerge added a commit that referenced this pull request Jan 9, 2025
BREAKING CHANGE:
`createDocumentLoader` is renamed to `createDocumentLoaderFromClient`
`createSharedListener` is renamed to `createDocumentLoaderFromClient`
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.

2 participants