From 448ef3b9d41ce004198eeceb7a809895a8752ab9 Mon Sep 17 00:00:00 2001 From: Clauderic Demers Date: Thu, 10 Aug 2023 08:46:57 -0400 Subject: [PATCH] Fix a bug with @computed decorator --- packages/state/src/decorators.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/state/src/decorators.ts b/packages/state/src/decorators.ts index 2ef48ec0..2dfc1060 100644 --- a/packages/state/src/decorators.ts +++ b/packages/state/src/decorators.ts @@ -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; }