Skip to content

[base-controller] ControllerMessenger selectors skip initial value #3649

@Gudahtt

Description

@Gudahtt

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingteam-wallet-frameworkDeprecated: Please use `team-core-platform` instead.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions