It doesn't look like the `cb` that is actually passed in uses the second argument.  If you stop passing that, then you can simplify this to just `setTimeout(cb, 0)`.

Also, do you really need the `setTimeout()` here?  Since the success event will be async already you can probably just drop it.  So this simplifies further to `req.onsuccess = cb`.