Re:ES6: The features I'm most excited about
by grandalf on Monday July 06, 2015 @01:29AM
(#9836977)
I see. Not sure what the best practice is for the losing scope in then chains issue with promises. I ended up creating something along the lines of a message object designed for each chain, which felt like a smell.
[ Parent
| on HN ]
Feels like an un-compiler-assisted State monad.
IMO threading an object through is probably the best method, unfortunately. You could use an Immutable Record or something to help keep it under control.
I would personally just use async/await to more explicitly handle the sequencing/binding.