Skip to content

Commit

Permalink
Force properties to be enumerable, so mobx-state-tree can see them.
Browse files Browse the repository at this point in the history
  • Loading branch information
jjrv committed May 16, 2018
1 parent 0173513 commit 274cebc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/classy-mst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ export function mst<S, T, U>(Code: new() => U, Data: IModelType<S, T>, name?: st

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

// Allow mobx-state-tree to see the property, or it gets ignored.
desc.enumerable = true;

Object.defineProperty(result, name, desc);
}

Expand Down

0 comments on commit 274cebc

Please sign in to comment.