Skip to content

A simple way to asynchronously defer execution of code stored in a string to prevent main thread blockage

License

Notifications You must be signed in to change notification settings

anonyco/AsynchronousEvalFunction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

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 ));

Releases

No releases published

Packages

No packages published