Skip to content

Commit

Permalink
fix: prevState now works as intended
Browse files Browse the repository at this point in the history
  • Loading branch information
crutchcorn committed Nov 29, 2024
1 parent 7b0bdd2 commit d751b2d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/store/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export class Store<

// Attempt to flush
this._flush()
this.prevState = this.state
}

/**
Expand All @@ -78,6 +77,7 @@ export class Store<
for (const listener of this.listeners) {
if (this._flushing !== flushId) continue
listener({ prevVal: this.prevState, currentVal: this.state })
this.prevState = this.state
}
}

Expand Down

0 comments on commit d751b2d

Please sign in to comment.