From 52f8e22983c33e0dc606bb580ad814f8d566d716 Mon Sep 17 00:00:00 2001 From: christianalfoni Date: Mon, 14 Jan 2019 10:54:44 +0100 Subject: [PATCH] fix(overmind): make sure getters are managed in initial state --- packages/node_modules/overmind/src/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/node_modules/overmind/src/index.ts b/packages/node_modules/overmind/src/index.ts index 1fa3c72a..5715b160 100644 --- a/packages/node_modules/overmind/src/index.ts +++ b/packages/node_modules/overmind/src/index.ts @@ -536,7 +536,9 @@ export class Overmind implements Configuration { } else if (typeof value === 'function') { aggr[key] = new Derived(value) } else { - aggr[key] = value + var originalDescriptor = Object.getOwnPropertyDescriptor(state, key) + + Object.defineProperty(aggr, key, originalDescriptor as any) } return aggr