You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working with threejs and here using usePromise to load an external model it works the first time, but not on successive use of the loader on the same resource. Would be nice to have the ability to assign a function that defines the copy logic, with threejs this can be done with mesh.clone(); for example.
This is how the usePromise could work.
constdata=usePromise(fetchJson,['https://pokeapi.co/api/v2/pokemon/ditto/',{method: 'GET'},],{// options object instead of single argument for lifespanlifespan: 1000,onCache: (originalResponse)=>myCustomCloneFunction(originalResponse)});
The text was updated successfully, but these errors were encountered:
You can use fork of this package that solves this issues and also allows you to provide a custom cache comparer. Suppose custom comparer may be much better solution that custom clone function as far as this package doesn't clone promise result
I'm working with threejs and here using usePromise to load an external model it works the first time, but not on successive use of the loader on the same resource. Would be nice to have the ability to assign a function that defines the
copy
logic, with threejs this can be done withmesh.clone();
for example.This is how the usePromise could work.
The text was updated successfully, but these errors were encountered: