question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

loadAsync -> THREE.Loader

See original GitHub issue

Would it be possible for Expo to support the THREE.Loader signature like all other loaders?

class ExpoLoader {
  load (url: string, onLoad: function, onProgress: function, onError: function) {
    // ..
    // async fetching, processing, etc
    // ..
    onLoad(asset)
new ExpoLoader().load(url, data => console.log(data))

If that were the case react-three-fiber users could have useLoader and suspense:

function Model(url) {
  const { scene } = useLoader(ExpoLoader, url)
  return <primitve object={scene} />
}

<Suspense fallback={<SomethingElseWhileLoading />}>
  <Model url="/model.gltf" />
</Suspense>

As well as declarative GLTF: https://github.com/react-spring/gltfjsx this one especially is a pitty and i get lots of requests because people just expect it to work, which it could in theory if loadAsync is a loader. Traversing and mutating assets would be a thing of the past.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
EvanBaconcommented, Jun 2, 2020

I’ll investigate further

0reactions
drcmdacommented, Jun 4, 2020

sure, could need all the help i can get!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Loader#loadAsync – three.js docs
Base class for implementing loaders. Constructor. Loader( manager : LoadingManager ). manager — The loadingManager for the loader to use. Default is THREE....
Read more >
ThreeJS loader loadAsync promise resolves to null without ...
I do not need the promise to resolve immediately as I am using threejs' loading manager as well. textureLoader.loadAsync(assets.normal).then(res ...
Read more >
three.TextureLoader.loadAsync JavaScript and Node.js code ...
Best JavaScript code snippets using three.TextureLoader.loadAsync(Showing top 1 results out of 315) ... const imageTexture = await textureLoader.
Read more >
Asynchronous JavaScript - Discover three.js!
loadAsync means you no longer need most of the information from this chapter ... No more asynchronous callback functions, no more converting loaders...
Read more >
How to use the expo-three.loadAsync function in expo ... - Snyk
Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately. Enable here. github expo /...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found