Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
y2k committed Jun 8, 2019
1 parent 6fa8ddf commit 5e52f77
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/kotlin/y2k/tea/runtime.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ class TeaRuntime<Model, Msg>(

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) }
Expand Down

0 comments on commit 5e52f77

Please sign in to comment.