Skip to content

Commit

Permalink
chore: add deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
isekovanic committed Oct 25, 2024
1 parent 5f8a45d commit 5410055
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ export class StateStore<T extends Record<string, unknown>> {

let hasUpdatedValues = !selectedValues;

if (Array.isArray(selectedValues)) {
console.warn(
'The API of our state store has changed. Instead of returning an array in the selector, please return a named object of properties.',
);
}

for (const key in selectedValues) {
if (selectedValues[key] === newlySelectedValues[key]) continue;
hasUpdatedValues = true;
Expand Down

0 comments on commit 5410055

Please sign in to comment.