Skip to content

feat(sanity): support create live data with single query#8

Merged
osnoser1 merged 2 commits into
mainfrom
feature/create-live-data-with-one-query
Jan 2, 2025
Merged

feat(sanity): support create live data with single query#8
osnoser1 merged 2 commits into
mainfrom
feature/create-live-data-with-one-query

Conversation

@osnoser1

@osnoser1 osnoser1 commented Jan 2, 2025

Copy link
Copy Markdown
Member

PR Checklist

This PR enhances the documentation and functionality of createLiveData in the Sanity package.

What is the new behavior?

  • Added documentation for single query usage of createLiveData

  • Enhanced createLiveData to support both single query and multiple queries configurations

  • Added code examples demonstrating both usage patterns:

    // Single query usage
    const livePost = createLiveData(
      () => initialPost,
      () => ({
        query: postQuery,
        params: { slug: 'my-post' },
      }),
    );
    
    // Multiple queries usage (existing functionality)
    const liveData = createLiveData(
      () => initialData,
      () => ({ ... })
    );
  • Updated type definitions to support both patterns

  • Enhanced parameter documentation to clarify the two supported query configurations

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

This change improves developer experience by simplifying the API for single query use cases while maintaining backward compatibility for multiple queries.

[Optional] What gif best describes this PR or how it makes you feel?

@netlify

netlify Bot commented Jan 2, 2025

Copy link
Copy Markdown

Deploy Preview for limitless-angular-sanity-example ready!

Name Link
🔨 Latest commit c7d95d8
🔍 Latest deploy log https://app.netlify.com/sites/limitless-angular-sanity-example/deploys/6776c48230435300088e105f
😎 Deploy Preview https://deploy-preview-8--limitless-angular-sanity-example.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@osnoser1 osnoser1 changed the title Feature/create live data with one query feat(sanity): support create live data with single query Jan 2, 2025
@nx-cloud

nx-cloud Bot commented Jan 2, 2025

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit c7d95d8.

Command Status Duration Result
nx affected -t lint build ✅ Succeeded 1m 32s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-02 16:55:34 UTC

@osnoser1 osnoser1 merged commit c636f50 into main Jan 2, 2025
@osnoser1 osnoser1 deleted the feature/create-live-data-with-one-query branch January 2, 2025 17:27
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.

1 participant