mobx-keystone
Advanced tools
Changelog
0.63.1
FromSnapshotDefaultType<typeof props>
and ToSnapshotDefaultType<typeof props>
so the default type does not need to be repeated when using fromSnapshotProcessor
/ toSnapshotProcessor
.Changelog
0.63.0
fromSnapshot
has been removed in favor of fromSnapshotProcessor
/ toSnapshotProcessor
options of Model
/ ExtendedModel
. These allow you to set up pre/post snapshot processors for models.Changelog
0.62.0
$modelId
is no longer a requirement and will be no longer automatically added to models. If you want your models to keep using the old behavior (having a $modelId
property) then add a [modelIdKey]: idProp
or a $modelId: idProp
property to them. Note that $modelId
can still be used in instances to get/set the current ID property, just that it might be undefined (get) / throw (set) when there is none.Changelog
0.61.3
onAttachedToRootStore
more more often than it should.Changelog
0.61.2
idProp
.Changelog
0.61.1
types.model
sometimes picking any as the model type.Changelog
0.61.0
withTransform()
, a new way to do property transforms, as well as the pre-made transforms timestampToDateTransform
, isoStringToDateTransform
, objectToMapTransform
, arrayToMapTransform
and arrayToSetTransform
. See the docs Maps, Sets, Dates
section for more info.apply
and applyComputed
to contexts so that they can be used to share information with models on creation time (kind of like envs
in Mobx-state-tree). See the context docs for more details.asMap
where the map would not get updated when the backing array/object changed.asSet
where the set would not get updated when the backing array changed.