Skip to content

Commit

Permalink
fix forms updateOrSet
Browse files Browse the repository at this point in the history
  • Loading branch information
George-Payne committed Jan 15, 2025
1 parent b0f2624 commit e63b24d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/ninety-dolls-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@kurrent-ui/stores': patch
---

Bug Fix: `updateOrSet` returns the current value as-is, in line with `update`
2 changes: 1 addition & 1 deletion packages/stores/src/stores/createListStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export const createListStore = <T>(
},
updateOrSet: (id, updater, creator) => {
if (id in state) {
state[id] = updater({ ...state[id] });
state[id] = updater(state[id]);
return true;
}
state[id] = creator();
Expand Down

0 comments on commit e63b24d

Please sign in to comment.