Skip to content

Commit 274cebc

Browse files
committed
Force properties to be enumerable, so mobx-state-tree can see them.
1 parent 0173513 commit 274cebc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/classy-mst.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ export function mst<S, T, U>(Code: new() => U, Data: IModelType<S, T>, name?: st
159159

160160
if(set) desc.set = (value: any) => set.call(self, value);
161161

162+
// Allow mobx-state-tree to see the property, or it gets ignored.
163+
desc.enumerable = true;
164+
162165
Object.defineProperty(result, name, desc);
163166
}
164167

0 commit comments

Comments
 (0)