From 5e52f77555916ac438e2a96bdf56c777d9e421c1 Mon Sep 17 00:00:00 2001 From: y2k Date: Sat, 8 Jun 2019 20:00:36 +0300 Subject: [PATCH] bugfix --- src/main/kotlin/y2k/tea/runtime.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/y2k/tea/runtime.kt b/src/main/kotlin/y2k/tea/runtime.kt index 60fa6a0..616a3b2 100644 --- a/src/main/kotlin/y2k/tea/runtime.kt +++ b/src/main/kotlin/y2k/tea/runtime.kt @@ -29,9 +29,10 @@ class TeaRuntime( fun dispatch(msg: Msg) { val (model, cmd) = component.update(model!!, msg) - if (compareModels && this.model == model) return - this.model = model - view.view(model) + if (!compareModels || this.model != model) { + this.model = model + view.view(model) + } scheduler { cmd.dispatchers.forEach { it(::dispatch) }