developit / greenlet

🦎 Move an async function into its own thread.
https://npm.im/greenlet
4.67k stars 100 forks source link

Too many levels of indentation #17

Closed tbodt closed 6 years ago

tbodt commented 6 years ago

The deepest line has 8 levels of indentation, which is honestly way too many. I'd suggest building the web worker code string in a variable, then simply do new WebWorker(URL.createObjectURL(new Blob([code]))). Then you'd be down to 4 levels.

TrySound commented 6 years ago

@tbodt Indentation where?

tbodt commented 6 years ago

In greenlet.js. #18

developit commented 6 years ago

I'm fine with splitting things up as long as there is no size impact (if Uglify will collapse the single-use variables).