-
Notifications
You must be signed in to change notification settings - Fork 107
Open
Labels
Description
Is your feature request related to a problem? Please describe.
I want to have a component that mutates the state locally with validation in a transactional manner. For example, I have a user object:
store({
name: 'my name',
address: {
street: 'some avenue',
city: 'some city',
}
})
The UI will have a modal dialog for address that will get it as a prop and will only "commit" to the store if address is valid.
<AddressDialog address={address} onChange={(validNewAddress) => store.address = validNewAddress} onCancel={() => ???} />
Describe the solution you'd like
Very similar to https://github.com/mobxjs/mobx-utils#viewmodel
Describe alternatives you've considered or seen elsewhere
none
Additional context
none