[dojo-contributors] Promises

Eugene Lazutkin eugene at lazutkin.com
Fri Mar 5 13:19:44 EST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Inline.

On 3/5/10 5:56 AM, Mike Wilcox wrote:
> 
> So to me, a setTimeout is an elegant solution (and the only one),
> since the call is async anyway and an extra millisecond is
> inconsequential, and it keeps the Deferred/Promise from capturing the
> development code.

1) Try order of magnitude more --- the delay is usually 15-20ms.

2) Throwing anything from a setTimeout() callback doesn't help you to
find the source of error. Obviously if your source is the one and only
XHR in your app, it is not a problem, but as soon as you have more than
one the whole idea becomes problematic.

Eugene
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkuRS0AACgkQY214tZwSfCtQBgCfZ+Vn/7txkczdfaJgHnTwB3FJ
W5sAni7cbRy2rn/QhtNcrslJy/jAq1L4
=4nl0
-----END PGP SIGNATURE-----


More information about the dojo-contributors mailing list