Skip to content

Analysis: Async Await Composition

Daniel Levy edited this page Aug 4, 2017 · 4 revisions

Meets requirements/goals?

[ ] Reads like a story [ ] No ad hoc logic (if's tangled up with function calls inside other functions) [ ] Same interface for synchronous & asynchronous code [ ] Consistent async pattern (related to above) [x] Flat & Highly Modular [x] Function Complexity score less than 9 (w/ 1-2 exceptions) [ ] Entangled Code Paths (related to previous) [ ] Immutable or treats values as immutable [x] Mostly stateless

Despite missing my requirements, this mix of modular JS + async/await is still quite readable to an experienced developer. This pattern may be the best start for those already familiar with Object Oriented Programming. Essentially it gets really close to my design goals, without using an execution pipeline.

image