Skip to content

Commit

Permalink
fix: update model when the model has changed after exucuting multiple…
Browse files Browse the repository at this point in the history
… messages (regression)
  • Loading branch information
atheck committed Sep 25, 2023
1 parent 5e9d4ed commit d9d1b5d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/useElmish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ function useElmish<TProps, TModel, TMessage extends Message>({
let modified = false;

do {
modified ||= handleMessage(nextMsg);
if (handleMessage(nextMsg)) {
modified = true;
}

nextMsg = buffer.shift();
} while (nextMsg);
Expand Down

0 comments on commit d9d1b5d

Please sign in to comment.