lexmihaylov/AsyncUtils

View on GitHub
examples/thread.html

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html>
    <body>
        <script type="text/javascript" src="../AsyncUtils.js"></script>
        
        <script>
            var thread = new AsyncUtils.Thread(function() {
                var i = 0;
                
                while(i < 10000000000) {i++};
                
                return 'Some Result';
            });
            
            thread.start().exec().then(function(result) {
                console.log(result);
            });
        </script>
    </body>
</html>