Skip to content

Latest commit

 

History

History
10 lines (7 loc) · 488 Bytes

README.md

File metadata and controls

10 lines (7 loc) · 488 Bytes

AsyncGlobalEvalFunction

A simple way to asynchronously defer the execution of javascript code stored as a string to prevent main thread blockage. Example:

AsyncGlobalEvalFunction("function(i){console.log('Hello World ', i)}", function(f){f(1); f(2); f(3)});
AsyncGlobalEvalFunction("x => x * x", function(f){console.log( f(8) )});
AsyncGlobalEvalFunction("async function * () {}", f => console.log( "Asynchronous generator function (what did you expect?): ", f ));