canmove, Confirmed users
725
edits
No edit summary |
No edit summary |
||
| Line 17: | Line 17: | ||
== Proposed solution<br> == | == Proposed solution<br> == | ||
Everything takes a callback as its last argument. Callbacks always take an error as their first argument. If null/undefined, there wasn't an error. | Everything takes a callback as its last argument. Callbacks always take an error as their first argument. If null/undefined, there wasn't an error. The second argument is the return value, if needed. | ||
This convention allows us to write things in an async way, but also develop utilities for syntactic sugar (chain, map, possibly even yield). | |||
This is a massive undertaking (see below), so until we can get rid of Sync.js completely, let's ''divide and conquer'': The codebase is converted to async calls step by step, from the inside out. Private helpers are turned async without backwards compatibility. The more public API methods are made async and renamed to methodCb while we provide a sync version of it under the old name for backwards compatibility (using Sync.js). | |||
== Task overview == | == Task overview == | ||