The ControllerMessenger subscribe function accepts an optional "selector" which can act like a Redux selector in that it narrows the state to just the subset that is of interest to that subscriber. The subscriber isn't invoked unless that specific piece of state is updated.
However, these selectors don't consider the initial state. They will always run upon the first state change, regardless what has changed.
We should update the ControllerMessenger to cache the initial state as well, so that we can use that for a point of comparison even on the first update.
The ControllerMessenger
subscribefunction accepts an optional "selector" which can act like a Redux selector in that it narrows the state to just the subset that is of interest to that subscriber. The subscriber isn't invoked unless that specific piece of state is updated.However, these selectors don't consider the initial state. They will always run upon the first state change, regardless what has changed.
We should update the
ControllerMessengerto cache the initial state as well, so that we can use that for a point of comparison even on the first update.