From c55128f096e3ee32d29e4a9caa4692b2a64a9dd8 Mon Sep 17 00:00:00 2001 From: phiresky Date: Fri, 19 Jan 2024 16:56:04 +0100 Subject: [PATCH] return action initializer instead of using addInitializer --- packages/mobx/src/types/actionannotation.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/mobx/src/types/actionannotation.ts b/packages/mobx/src/types/actionannotation.ts index 831cf5236..9451a22df 100644 --- a/packages/mobx/src/types/actionannotation.ts +++ b/packages/mobx/src/types/actionannotation.ts @@ -75,10 +75,7 @@ function decorate_20223_(this: Annotation, mthd, context: DecoratorContext) { // Backwards/Legacy behavior, expects makeObservable(this) if (kind == "field") { - addInitializer(function () { - storeAnnotation(this, name, ann) - }) - return + return _createAction } if (kind == "method") {