Skip to content

Commit

Permalink
Fix a bug with @computed decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
clauderic committed Aug 10, 2023
1 parent 937a139 commit 448ef3b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/state/src/decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ export function reactive(target: Object, propertyKey: string) {
set(value: any) {
const stored = store.get(this);

if (stored && stored.peek() !== value) {
stored.value = value;
if (stored) {
if (stored.peek() !== value) {
stored.value = value;
}
return;
}

Expand Down

0 comments on commit 448ef3b

Please sign in to comment.