Also modifies #2049 to use this.name instead of this.describe, since describe just iterates over children and their types and doesn't actually use name.
const Model = types.model("Name", { value: t.number });
const model = Model.create({ value: 5 });
const array = types.array(Model).create()
const map= types.map(Model).create()
// previous
console.log(getDebugName(model)) // { value: number }
console.log(getDebugName(array)) // { value: number }[]
console.log(getDebugName(map)) // map<string,{ value: number }>
// now
console.log(getDebugName(model)) // Name
console.log(getDebugName(array)) // Name[]
console.log(getDebugName(map)) // Map<string, Name>
What does this PR do and why?
Adds a test to https://github.com/mobxjs/mobx-state-tree/pull/2049 Closes https://github.com/mobxjs/mobx-state-tree/issues/2055
Also modifies #2049 to use
this.name
instead ofthis.describe
, since describe just iterates over children and their types and doesn't actually use name.