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.

Missing callbacks for parse function in JSONLoader

See original GitHub issue

Hi there! I just found out that parse function of JSONLoader doesn’t have onLoad and onError callbacks like GLTFLoader (for example). Mine is just a suggestion for a feature that might be useful, especially if parse function is used in a Promise or to check if JSON file could be corrupted in any way.

I hope this will be helpfull. (Love this project, by the way 😄)

Three.js version
  • Dev
  • r92
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Mugen87commented, Jun 1, 2018

Unifying the interface and behavior of the loaders would be a great thing. One long-standing issue from my point of view is that some loaders have parse() methods which only return if all resources like textures are loaded (e.g.ObjectLoader). Other loaders like JSONLoader or ColladaLoader return earlier as soon as the geometry data are parsed.

0reactions
mrdoobcommented, Aug 29, 2018

We’re in the process of moving away from JSONLoader so better to leave it as it is.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java callback to javascript, params lost "\", and json parse error
Your original java json string is wrong, the "data":{"key1":value1}. And if you want to check if your json format is correct or not, ......
Read more >
ethdeploy-solc-json-loader - npm package | Snyk
Looks like ethdeploy-solc-json-loader is missing a security policy. ... file produced by ethdeploy * @return {String} parsedOutput parsed output */ function ...
Read more >
Untitled
76 * 77 * @param {String} jsonUrl URL to load, missing the callback function name 78 ... new TimeMap.loaders.remote(options); 132 loader.parse = JSON.parse; ......
Read more >
I18next-xhr-backend-thor NPM | npm.io
Define a custom xhr function, webpack's bundle loader will load the translations for you. function loadLocales(url, options, callback, ...
Read more >
gonzales-pe | Yarn - Package Manager
Gonzales PE is a CSS parser which plays nicely with preprocessors. Currently those are supported: SCSS, Sass, LESS. Try out Gonzales PE online:...
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