From 85a92bf8132af701678e73e5e5dcdfe23a95ca65 Mon Sep 17 00:00:00 2001 From: RoB Murdock Date: Thu, 13 Jul 2023 14:19:35 -0400 Subject: [PATCH] minor refactor --- .../zegreatrob/coupling/client/DecoratedDispatchFunc.kt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/client/src/jsMain/kotlin/com/zegreatrob/coupling/client/DecoratedDispatchFunc.kt b/client/src/jsMain/kotlin/com/zegreatrob/coupling/client/DecoratedDispatchFunc.kt index bdace7f0bf..597e90f5bb 100644 --- a/client/src/jsMain/kotlin/com/zegreatrob/coupling/client/DecoratedDispatchFunc.kt +++ b/client/src/jsMain/kotlin/com/zegreatrob/coupling/client/DecoratedDispatchFunc.kt @@ -14,13 +14,10 @@ class DecoratedDispatchFunc( override fun , R> invoke(commandFunc: () -> C, response: (R) -> Unit) = fun() { val command = commandFunc() - dispatcher.asyncExecute(command, response) - } - - private fun , R> D.asyncExecute(command: C, onResponse: (R) -> Unit) = tools.performAsyncWork( - { execute(command) }, + { command.execute(dispatcher) }, { handler: Throwable -> throw handler }, - onResponse, + response, ) + } }