Mobx-state-tree: Introduce optional generic argument in types.frozen (and types.localState) to make it easily strong typeable

Created on 10 Jun 2017  路  3Comments  路  Source: mobxjs/mobx-state-tree

Most helpful comment

New plan: Support types.immutable(Type) which basically froze the node and throw if childs or node is changing

All 3 comments

New plan: Support types.immutable(Type) which basically froze the node and throw if childs or node is changing

really nice idea, I've got some nodes that are supposed to be immutable once attached to a type but there's no way to enforce it other than making the type itself actionless (e.g points, colors...)

This can now be expressed using types.custom as well (which just returns the value in the from/to snapshot functions without further transformation)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EricForgy picture EricForgy  路  4Comments

donatoaz picture donatoaz  路  3Comments

lishine picture lishine  路  4Comments

marszhou picture marszhou  路  3Comments

ShootingStarr picture ShootingStarr  路  4Comments