Skip to content
Discussion options

You must be logged in to vote

Please see the section "Creating the Store" in the docs: https://arkivanov.github.io/MVIKotlin/store.html

Why factory and not just an instance of the Executor? Because of the time travel feature. When debugging time travel events it creates separate instances of Executors when necessary and fakes their States.

Please note that executorFactory should return a new instance of the Executor every time it is called.

The following is also mentioned in that doc:

Please note that Executors are stateful and so can not be objects (singletons).

Here are the answers:

Can I store the reference to the Job inside the executor class?

Yes you can.

Won’t there be a case where a new executor is cre…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@yeldar-nurpeissov
Comment options

@arkivanov
Comment options

Answer selected by yeldar-nurpeissov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants