Skip to content

Rohit/33 #68

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Rohit/33 #68

wants to merge 3 commits into from

Conversation

rohitkumarxyz
Copy link

#33 issue number

Image Fetching Optimization

Changes Made

  1. Split image fetching into two APIs:

    • /images - Fetches all old images at once
    • /poll/images/:requestId - Fetches individual new images by ID
  2. State Management:

    • Switched to Zustand for managing request IDs
    • Tracks pending image generations
  3. Process:

    • Initial load: Fetches all old images
    • New generations: Polls individual images by ID
    • Updates UI in real-time as images are generated

Benefits

  • Reduced unnecessary data fetching
  • Better performance
  • Real-time updates for new generations

@skushagra9
Copy link

Yeah looks good overall, can add requests to another collection, just to make it cleaner, other than this good to go, will test this later once

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