Wagtail client-side components
    Preparing search index...
    • Parameters

      • localId: number

      Returns (
          state: { comments: CommentsState; settings: SettingsState },
          ...params: [],
      ) => undefined | Comment & {
          clearCache: () => void;
          resetResultsCount: () => void;
          resultsCount: () => number;
      } & {
          dependencies: [
              (
                  state: { comments: CommentsState; settings: SettingsState },
              ) => Map<number, Comment>,
          ];
          dependencyRecomputations: () => number;
          lastResult: () => undefined | Comment;
          memoizedResultFunc: (
              ...resultFuncArgs: [Map<number, Comment>],
          ) => undefined | Comment & {
              clearCache: () => void;
              resetResultsCount: () => void;
              resultsCount: () => number;
          };
          recomputations: () => number;
          resetDependencyRecomputations: () => void;
          resetRecomputations: () => void;
          resultFunc: (
              ...resultFuncArgs: [Map<number, Comment>],
          ) => undefined | Comment;
      } & {
          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;
          };
      }

        • (
              state: { comments: CommentsState; settings: SettingsState },
              ...params: [],
          ): undefined | Comment
        • A function that takes a state and returns data that is based on that state.

          Parameters

          • state: { comments: CommentsState; settings: SettingsState }

            The first argument, often a Redux root state object.

          • ...params: []

            All additional arguments passed into the selector.

          Returns undefined | Comment

          A derived value from the state.

      • clearCache: () => void
      • resetResultsCount: () => void
      • resultsCount: () => number
      • dependencies: [
            (
                state: { comments: CommentsState; settings: SettingsState },
            ) => Map<number, Comment>,
        ]

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

      • dependencyRecomputations: () => number

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

        5.0.0

      • lastResult: () => undefined | Comment

        The last result calculated by memoizedResultFunc.

      • memoizedResultFunc: (...resultFuncArgs: [Map<number, Comment>]) => undefined | Comment & {
            clearCache: () => void;
            resetResultsCount: () => void;
            resultsCount: () => number;
        }

        The memoized version of resultFunc.

      • recomputations: () => number

        Counts the number of times memoizedResultFunc has been recalculated.

      • resetDependencyRecomputations: () => void

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

        5.0.0

      • resetRecomputations: () => void

        Resets the count of recomputations count to 0.

      • resultFunc: (...resultFuncArgs: [Map<number, Comment>]) => undefined | Comment

        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 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