dob is a tool for monitoring object changes by using Proxy.
1 | import { observable, observe } from "dob" |
Look at the above results, if the changed field obj.text
is used in the observer
‘s callback, change it will re-execute this function, but obj.name
is not used, so it will not re-execute when change it.
As you can see, even if you modify a property without a preset value, it still works.
Using dob with react
dob-react can bind dob to React, read For react for more information.
dob-react-devtools is a good library to help you debug code written by
dob
.
Using both dob and redux
If you want to use functional development, as well as redux-devtools, but tired of immutable tedious usage, you can now use mutable methods to replace immutable wording.
dob-redux can bind dob to Redux. You can keep using react-redux and all the redux ecology.
If
dob-react
is used, there is no need to usedob-redux
, it’s only offered as another development idea.