Strong return type when passing a bare Promise; return promise from preload
Hi! Very good and wonderful library, I made some changes to suit my project, maybe they're helpful?
- Return type is now inferred when passing a bare Promise
-
preloadnow returns the cached Promise, so you can know when preloading is done
I would love to see the second change in particular propagate out to @react-three/fiber's useLoader, drei's useTexture etc! It allows more strategic preloading of assets (wait for high-priority assets to load before loading others).
This works in my project but I definitely haven't tested it exhaustively.
Approve this PR please. I need this futures.
Hey thanks for the contribution, you've changed a lot just to make return a stronger type – can you elaborate on why you've made the much larger changes?
no, i barely remember doing this! 🙃