Hello,

I have made my own js library using emscripten and I don't really know how 
to manage initializatoin to be user-friendly.

I use -s MODULARIZE=1 and  EXPORT_NAME=My_lib, so the generated code only 
gives a function named My_lib.
So, the user has to call the function himself and store the result :
var my_lib = My_lib();

I use embind, so after this function has exited, the library is not yet 
ready since global initializers need to be run to init bindings.

My question is how can I make sure everything is ready after calling an 
init function ?
The objective is to have a user friendly way of initalizing the library, 
such as :

var my_lib = My_lib();
my_lib.init()
do_something();

Wheras for now, I have to rely on 'postRun' to do that, which requires 
users to know about emscripten :

var my_lib = My_lib({'postRun' : do_something});

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to