Skip to content

Altering an observed value. #204

Answered by xaviergonz
maccman asked this question in Q&A
Discussion options

You must be logged in to vote

You can clone using the clone function:

https://mobx-keystone.js.org/snapshots#clonet-extends-objectvalue-t-options-cloneoptions-t

Then to alter it you can either use your own custom modelAction, runUnprotected (although not usually recommended since it wouldn't be recorded as an ation) or any of the predefined fnObject functions (if you don't want to create your own):

https://mobx-keystone.js.org/functionalModels#predefined-fnobject-and-fnarray

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by xaviergonz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants