mohitk05 / react-insta-stories

A React component for Instagram like stories
https://mohitk05.github.io/react-insta-stories/
MIT License
1.37k stars 247 forks source link

Add preloading to stories #274

Closed slytter closed 1 year ago

slytter commented 1 year ago

Fixing #273

I've added a hook:usePreLoader into Container.tsx that will preload both images and video from currentId towards the new prop preloadCount which defaults to 1. We could also set preloadCount to 0, if we wan't to disable it by default (might be less opinionated)

I've added some more images to example and it seems like its working perfectly when looking at the network profiler. (bit unsure about the video though)

I'm open to looking at any feedback :)

vercel[bot] commented 1 year ago

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

Name Status Preview Comments Updated (UTC)
react-insta-stories ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 13, 2023 0:45am
mohitk05 commented 1 year ago

Great contribution :) Thanks for the well-commented code! Can you also add this prop to the user documentation in README?

slytter commented 1 year ago

Hey @mohitk05, did you get a chance to look at my recent commits?

mohitk05 commented 1 year ago

Hey @slytter I missed these updates, can you resolve the conflicts and update your PR?

slytter commented 1 year ago

Alright, it's merged!

mohitk05 commented 1 year ago

Available in 2.6.2!