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.

Remove the need for a global THREE Object

See original GitHub issue

Is it possible to remove the need for a global THREE-Object, now that there are threejs modules?

Readme:

// For ES6, see: https://github.com/mrdoob/three.js/issues/9562
// CommonJS
const THREE = window.THREE = require('three');

My usecase is when I import Pathfinding from npm in my project I have to provide THREE globally. Maybe this could be done more elgeant?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

0reactions
donmccurdycommented, Mar 28, 2020

There’s a proposed fix for this in https://github.com/donmccurdy/three-pathfinding/pull/62, by @soelen. Feedback welcome!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Object3D#remove – three.js docs
Any current parent on an object passed in here will be removed, since an object can have at most one parent. See Group...
Read more >
THREE.js object removing - javascript - Stack Overflow
Try moving the function declaration outside of the init function and declaring sphere2 as a global variable. var sphere2; function init() { ...
Read more >
Chapter 22 Removing Objects from the R Environment
This chapter's tutorial demonstrates how to remove objects from the R Environment. 22.2.1 Video Tutorial. As usual, you have the choice to follow...
Read more >
delete operator - JavaScript - MDN Web Docs - Mozilla
The delete operator removes a given property from an object. On successful deletion, it will return true , else false will be returned....
Read more >
Discovering JavaScript: Three Objects New Developers Must ...
Global variables and global objects are bound to the global object. Built-in objects are global objects because they exist in the global scope....
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