Mobx offers observer package which is only compatible with react, it makes it known to the store that data is being used and will rerun component on change. How do you replicate mobx observer support?
Mobx observers can be used like this:
@observable
name = 'bob'
function render( n ){ return (`<div>Hello ${n}</div>`) }
autorun( () =>{
document.getEelementById('baseOfApp').innerHTML = render( name )
})
As name changes the function passed to autorun will be re-run. In this code react and mobx-react are not being used.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With