You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Renamed `createFactory` to `types.model` (breaking!)
4
+
* Renamed `composeFactory` to `types.extend` (breaking!)
5
+
* Models are no longer constructed by invoking the factory as function, but by calling `factory.create` (breaking!)
6
+
* Introduced `identifier`
7
+
* Introduced / improved `reference`
8
+
* Greatly improved typescript support, type inference etc. However there are still limitations as the full typesystem of MST cannot be expressed in TypeScript. Especially concerning the type of snapshots and the possibility to use snapshots as first class value.
thrownewError(`Argument ${index} that was passed to action '${actionName}' is a model that is not part of the same state tree. Consider passing a snapshot or some representative ID instead`)
60
53
return({
61
-
$ref: getRelativePath(adm,getNode(arg))
54
+
$ref: getRelativePath(adm,getMST(arg))
62
55
})
63
56
}
64
57
if(typeofarg==="function")
65
58
thrownewError(`Argument ${index} that was passed to action '${actionName}' should be a primitive, model object or plain object, received a function`)
66
59
if(typeofarg==="object"&&!isPlainObject(arg))
67
-
thrownewError(`Argument ${index} that was passed to action '${actionName}' should be a primitive, model object or plain object, received a ${(arg&&arg.constructor) ? arg.constructor.name : "Complex Object"}`)
60
+
thrownewError(`Argument ${index} that was passed to action '${actionName}' should be a primitive, model object or plain object, received a ${(argasany&&(argasany).constructor) ? (argasany).constructor.name : "Complex Object"}`)
68
61
if(isObservable(arg))
69
62
thrownewError(`Argument ${index} that was passed to action '${actionName}' should be a primitive, model object or plain object, received an mobx observable.`)
70
63
try{
@@ -77,7 +70,7 @@ function serializeArgument(adm: Node, actionName: string, index: number, arg: an
0 commit comments