Management of whether ui components are visible in mobx?

there is a problem with using mobx:

obtain the backend interface data through @ action, then assign a value to @ observable data, and then calculate whether the modal needs to be displayed from data through @ computed modalVisiable. How can I change the @ computed value modalVisiable to false if modal, is turned off?

how should the state of ui components like modalVisiable be managed through mobx?


since your modalVisiable is calculated through data, you can change data through @ action and indirectly change modalVisiable to false

.
Menu