arkivanov/MVIKotlin

Consider executeIntent and executeAction in DSL

arkivanov opened this issue · 1 comments

Consider executeIntent and executeAction in DSL

After some digging and experimenting, there some downsides:

  1. The ability to execute Intents and Actions from DSL handlers would make the API more complex. E.g. CoroutineExecutorScope and ReaktiveExecutorScope would receive two additional type parameters - Intent and Action.
  2. Currently the data flow in DSL-based code is kinda uni-directional. E.g. handlers have Intent and Action as inputs, and Message and Label as output. The ability to execute Intents and Actions from DSL handlers would add some mess - Intents and Actions are inputs and outputs at the same time. This doesn't look clean.

It's advised to extract common methods, as demonstrated in the sample.