process.nextTick for browser.
$ component install timoxley/next-tick
// This example sucks.
var nextTick = require('next-tick')
var i = 0;
nextTick(function() {
i++ // i === 2
})
i++ // i === 1This implementation mirrors the behaviour of node's process.nextTick. Therefore, it comes with all the same benefits and caveats. see node's documentation for details
Adapted from mocha codebase.
MIT