Reference equality, the default for a derived value.
The failure it exists to make visible: a selector that builds a fresh object every call is never
equal to itself, so a component subscribed to it re-renders forever. That is the most common way a
store is misused, in every library on the market, so the rule is documented rather than folklore:
select values, or memoise what you build.
Reference equality, the default for a derived value.
The failure it exists to make visible: a selector that builds a fresh object every call is never equal to itself, so a component subscribed to it re-renders forever. That is the most common way a store is misused, in every library on the market, so the rule is documented rather than folklore: select values, or memoise what you build.