MVIKotlin icon indicating copy to clipboard operation
MVIKotlin copied to clipboard

Update KDocs in CoroutineExecutor

Open shynline opened this issue 3 years ago • 5 comments

https://github.com/arkivanov/MVIKotlin/blob/4bad89cb0b5aee04e3e9fa04d90bd4fbbc37900e/mvikotlin-extensions-coroutines/src/commonMain/kotlin/com/arkivanov/mvikotlin/extensions/coroutines/CoroutineExecutor.kt#L33-L35

https://github.com/arkivanov/MVIKotlin/blob/4bad89cb0b5aee04e3e9fa04d90bd4fbbc37900e/mvikotlin-extensions-coroutines/src/commonMain/kotlin/com/arkivanov/mvikotlin/extensions/coroutines/CoroutineExecutor.kt#L48-L50

shynline avatar Dec 04 '21 17:12 shynline

Hello, could you please elaborate? What do you think is not right?

arkivanov avatar Dec 04 '21 17:12 arkivanov

Now it's clear what you mean. I will copy my message from Kotlin Slack here for transparency.

Both executeAction and executeIntent were suspending functions a while ago, but it was an explicit decision to make them normal.

There is scope properly available which you can use to launch coroutines when needed. You can check samples: https://github.com/arkivanov/MVIKotlin/blob/master/sample/todo-coroutines/src/commonMain/kotlin/com/arkivanov/mvikotlin/sample/todo/coroutines/store/TodoListStoreFactory.kt

The reason for this change is because now you are able to process intents and actions synchronously in the same call stack as they were dispatched.

arkivanov avatar Dec 05 '21 09:12 arkivanov

Oh, I see. I honestly didn't know about the decision and also, comments for those functions didn't help since they're mentioning suspend function still. thanks

shynline avatar Dec 05 '21 11:12 shynline

Good point! I think we need to update KDocs instead.

arkivanov avatar Dec 05 '21 12:12 arkivanov

Moved to https://github.com/arkivanov/MVIKotlin/issues/2

arkivanov avatar Dec 17 '21 09:12 arkivanov