• A hook for tracking a subpart or a computed value derived from the RootState of a Store by a Selector function.

    This hook calls selector with the Store's RootState and returns the derived value. Then it watches the store, calling the selector again for every change to the RootState. If the value returned by selector is not identical to the last saved value, a re-render will be triggered (and this hook will return the new value).

    If your selector constructs a new data structure based on the RootState, (rather than just selecting some part of the Immutable RootState or calculating a primitive value), then it might return a non-identical value even when nothing has changed. Computed data structures should be memoized to minimise component refreshes.

    See Selector

    Type Parameters

    • State extends object

    • Selected

    Parameters

    Returns Immutable<Selected>

Generated using TypeDoc