Open markzyu opened 8 years ago
Quoted here:
We were using promises (ActionChain) the wrong way. Please take a look at my jsFiddle. (Please use a chrome browser. I am not so familiar with web Frontend and have no idea why this isn't compatible with Safari :D (maybe because it's ES6))
- We could reuse our code better if PureAction/Consumer/Producer are not directly operating on the piped data of ActionChain. We should ensure that, at any point in the ActionChain, the piped data is a dictionary. And all code should operate on the dictionary instead, while parameters will be replaced by the keys to find those objects.
- It's also advisable to create Agents to join two or more ActionChains together. This way we could ensure all related states of an ActionChain will be gathered within the Agents.
As a result, it's much more easier to debug, and create test cases for any fraction of our code (the fractions can be as small as PureAction/Consumer/Producer lambda expressions) because we can find out which states are related to that fraction of code and easily fake those states during a unit test (instead of having to use all sorts of injections)
Please refer to this Android application issue thread