ridatadiscoverycenter / react-aframe-volume-renderer

afreame-webgl2 volumen renderer as a reactjs app
MIT License
3 stars 0 forks source link

Remove self-invoking functions from Aframe files #61

Closed RobertGemmaJr closed 2 years ago

RobertGemmaJr commented 2 years ago

getMouseonCircle, getMouseOnScreen, and many more in arcball-controller.js. Seems to be in other files as well.

Using () => {} arrow functions will preserve the this scope so let _this = this is no longer needed. Moreover, the function definitions should not immediately call themselves like:

  let getMouseOnCircle = (function () {
     // do stuff
  })();

Define all the functions and then call them elsewhere

RobertGemmaJr commented 2 years ago

Swap out this.handleResize (line 97 in `acrball-controller.js) and similar functions for arrow functions as well

RobertGemmaJr commented 2 years ago

See if we could make all of these things into their own classes? Will need to get a better picture of what each file is doing

RobertGemmaJr commented 2 years ago

Issue moved to react-volume-viewer library