Where are the props defined on a model actually processed and applied to an instance on .create()? #1734
Answered
by
jamonholmgren
techknowfile
asked this question in
Q&A
-
Trying to replicate the logic for defining new Models by extending existing types with .actions, .views, and .props for a MobX store, where it won't use mobx-state-tree's typing (nor typescript). I understand how .actions() and .views() work, but am struggling to find the relevant code for where the properties assigned to a Type get applied to an actual instance of an object |
Beta Was this translation helpful? Give feedback.
Answered by
jamonholmgren
Jul 12, 2021
Replies: 1 comment
-
This is where the actual application happens: But this code is a bit difficult to follow, to be honest. I wish it was less complicated. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
jamonholmgren
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is where the actual application happens:
mobx-state-tree/packages/mobx-state-tree/src/core/node/object-node.ts
Line 133 in ac5ffcd
But this code is a bit difficult to follow, to be honest. I wish it was less complicated.