This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Zousan.evaluate( | |
{ name: "username", value: "glenn" }, | |
{ name: "score", value: 45 } | |
).then(function(ob) { | |
console.log("Hello " + ob.username + ". Your score is " + ob.score) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See http://www.bluejava.com/4NS/Speed-up-your-Websites-with-a-Faster-setTimeout-using-soon | |
// This is a very fast "asynchronous" flow control - i.e. it yields the thread and executes later, | |
// but not much later. It is far faster and lighter than using setTimeout(fn,0) for yielding threads. | |
// Its also faster than other setImmediate shims, as it uses Mutation Observer and "mainlines" successive | |
// calls internally. | |
// WARNING: This does not yield to the browser UI loop, so by using this repeatedly | |
// you can starve the UI and be unresponsive to the user. | |
// This is an even FASTER version of https://gist.github.com/bluejava/9b9542d1da2a164d0456 that gives up | |
// passing context and arguments, in exchange for a 25x speed increase. (Use anon function to pass context/args) | |
var soon = (function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See http://www.bluejava.com/4NS/Speed-up-your-Websites-with-a-Faster-setTimeout-using-soon | |
// This is a very fast "asynchronous" flow control - i.e. it yields the thread and executes later, | |
// but not much later. It is far faster and lighter than using setTimeout(fn,0) for yielding threads. | |
// Its also faster than other setImmediate shims, as it uses Mutation Observer and "mainlines" successive | |
// calls internally. | |
// WARNING: This does not yield to the browser UI loop, so by using this repeatedly | |
// you can starve the UI and be unresponsive to the user. | |
// Note: For an even faster version, see https://gist.github.com/bluejava/b3eb39911da03a740727 | |
var soon = (function() { | |
OlderNewer