[ALOY-1330] Include async as a built-in library
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | None |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Builtins |
Labels | n/a |
Reporter | Fokke Zandbergen |
Assignee | Bruce Wayne |
Created | 2015-11-13T10:24:04.000+0000 |
Updated | 2017-03-07T16:00:01.000+0000 |
Description
Enabling JS to run on the main thread may cause unexpected behaviour because calls on Ti Proxies will wait to be executed until the current JS codeblock is done. The remedy is to break up long procedures using
setTimeout(fn, 0)
or UnderScore's wrapped _.defer()
. We already have underscore in Alloy, but in particular when looping over an Array the code is more clean if you use something like the async-library. To make it easier for developers to implement best practices as we will eventually make main thread the default, we should include async as a built-in for Alloy.
https://www.npmjs.com/package/async
Comments
- Creative 2017-03-07