yt-project / widgyts

Widgets for yt
https://widgyts.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
10 stars 10 forks source link

Make async things a bit nicer #13

Closed matthewturk closed 6 years ago

matthewturk commented 6 years ago

This switches to using the import operation to bring in the webassembly. We can delay some things, like initialization of listeners (so no operations can happen on colormaps until that happens) but it looks like the render operation for fixed res still needs a promise.

Alternately, a considerably safer thing to do might be to wrap all our functions in promises that may be immediately resolved; for instance:

someFunction: function(){ return yt_tools.then( (yt_tools) => {
...
})})
matthewturk commented 6 years ago

I've changed this to use the "safer" version I note above.

munkm commented 6 years ago

I also think this addresses the major issues we were having with #9 .