Runs a side effect whenever the atom's state changes.
The state type.
The reducer map type.
The atom to observe.
The function to call with the new state.
Runs a side effect whenever the atom's state changes.