Websites v4 docs v5.2.4
    Preparing search index...

    Variable selectSelectedSectionConst

    selectSelectedSection: (
        state: { config: ConfigState } & { config: ConfigState },
        ...params: [],
    ) => { address: NodeAddress; section: Section<MixedSection> } | null & {
        clearCache: () => void;
        resetResultsCount: () => void;
        resultsCount: () => number;
    } & {
        dependencies: [
            (state: { config: ConfigState }) => { address: NodeAddress } | null,
            (
                state: { config: ConfigState },
            ) => Section<MixedSection> | null | undefined,
        ];
        dependencyRecomputations: () => number;
        lastResult: () => | {
            address: NodeAddress;
            section: Section<MixedSection>;
        }
        | null;
        memoizedResultFunc: (
            ...resultFuncArgs: [
                { address: NodeAddress }
                | null,
                Section<MixedSection> | null | undefined,
            ],
        ) => { address: NodeAddress; section: Section<MixedSection> } | null & {
            clearCache: () => void;
            resetResultsCount: () => void;
            resultsCount: () => number;
        };
        recomputations: () => number;
        resetDependencyRecomputations: () => void;
        resetRecomputations: () => void;
        resultFunc: (
            ...resultFuncArgs: [
                { address: NodeAddress }
                | null,
                Section<MixedSection> | null | undefined,
            ],
        ) => { address: NodeAddress; section: Section<MixedSection> } | null;
    } & {
        argsMemoize: <Func extends AnyFunction>(
            func: Func,
            options?: WeakMapMemoizeOptions<ReturnType<Func>>,
        ) => Func & {
            clearCache: () => void;
            resetResultsCount: () => void;
            resultsCount: () => number;
        };
        memoize: <Func extends AnyFunction>(
            func: Func,
            options?: WeakMapMemoizeOptions<ReturnType<Func>>,
        ) => Func & {
            clearCache: () => void;
            resetResultsCount: () => void;
            resultsCount: () => number;
        };
    } = ...

    Type Declaration

    • clearCache: () => void
    • resetResultsCount: () => void
    • resultsCount: () => number
    • dependencies: [
          (state: { config: ConfigState }) => { address: NodeAddress } | null,
          (
              state: { config: ConfigState },
          ) => Section<MixedSection> | null | undefined,
      ]

      The array of the input selectors used by createSelector to compose the combiner (OutputSelectorFields.memoizedResultFunc memoizedResultFunc).

    • dependencyRecomputations: () => number

      Counts the number of times the input selectors (OutputSelectorFields.dependencies dependencies) have been recalculated. This is distinct from OutputSelectorFields.recomputations recomputations, which tracks the recalculations of the result function.

      5.0.0

    • lastResult: () => { address: NodeAddress; section: Section<MixedSection> } | null

      The last result calculated by OutputSelectorFields.memoizedResultFunc memoizedResultFunc.

    • memoizedResultFunc: (
          ...resultFuncArgs: [
              { address: NodeAddress }
              | null,
              Section<MixedSection> | null | undefined,
          ],
      ) => { address: NodeAddress; section: Section<MixedSection> } | null & {
          clearCache: () => void;
          resetResultsCount: () => void;
          resultsCount: () => number;
      }

      The memoized version of OutputSelectorFields.resultFunc resultFunc.

    • recomputations: () => number

      Counts the number of times OutputSelectorFields.memoizedResultFunc memoizedResultFunc has been recalculated.

    • resetDependencyRecomputations: () => void

      Resets the count OutputSelectorFields.dependencyRecomputations dependencyRecomputations for the input selectors (OutputSelectorFields.dependencies dependencies) of a memoized selector.

      5.0.0

    • resetRecomputations: () => void

      Resets the count of OutputSelectorFields.recomputations recomputations count to 0.

    • resultFunc: (
          ...resultFuncArgs: [
              { address: NodeAddress }
              | null,
              Section<MixedSection> | null | undefined,
          ],
      ) => { address: NodeAddress; section: Section<MixedSection> } | null

      The final function passed to createSelector. Otherwise known as the combiner.

    • argsMemoize: <Func extends AnyFunction>(
          func: Func,
          options?: WeakMapMemoizeOptions<ReturnType<Func>>,
      ) => Func & {
          clearCache: () => void;
          resetResultsCount: () => void;
          resultsCount: () => number;
      }

      The optional memoize function that is used to memoize the arguments passed into the output selector generated by createSelector (e.g., lruMemoize or weakMapMemoize).

      When passed directly into createSelector, it overrides the argsMemoize function initially passed into createSelectorCreator. If none was initially provided, weakMapMemoize will be used.

      import { createSelector, weakMapMemoize } from 'reselect'

      const selectItemsByCategory = createSelector(
      [
      (state: RootState) => state.items,
      (state: RootState, category: string) => category
      ],
      (items, category) => items.filter(item => item.category === category),
      { argsMemoize: weakMapMemoize }
      )
      weakMapMemoize
      

      5.0.0

    • memoize: <Func extends AnyFunction>(
          func: Func,
          options?: WeakMapMemoizeOptions<ReturnType<Func>>,
      ) => Func & {
          clearCache: () => void;
          resetResultsCount: () => void;
          resultsCount: () => number;
      }

      The memoize function that is used to memoize the OutputSelectorFields.resultFunc resultFunc inside createSelector (e.g., lruMemoize or weakMapMemoize).

      When passed directly into createSelector, it overrides the memoize function initially passed into createSelectorCreator.

      import { createSelector, weakMapMemoize } from 'reselect'

      const selectItemsByCategory = createSelector(
      [
      (state: RootState) => state.items,
      (state: RootState, category: string) => category
      ],
      (items, category) => items.filter(item => item.category === category),
      { memoize: weakMapMemoize }
      )

      5.0.0