Subscribes to the state of an atom.
The state type.
The atom to subscribe to.
Optional
Optional comparator function to determine if state has changed.
The current state of the atom.
Subscribes to the state of an atom.