UNPKG

ra-core

Version:

Core components of react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React

18 lines 843 B
import { useContext } from 'react'; import { InfinitePaginationContext, } from './InfinitePaginationContext'; /** * Hook to read the infinite pagination callbacks from the InfinitePaginationContext. * * Must be used within a <InfinitePaginationContext.Provider> (e.g. as a descendent of <InfiniteList> * or <InfiniteListBase>). * * @typedef {Object} InfinitePaginationContextValue * @prop {Function} fetchNextPage a callback to fetch the next page * @prop {Function} fetchPreviousPage a callback to fetch the previous page * * @returns {InfinitePaginationContextValue} infinite pagination callbacks * * @see useInfiniteListController for how the callbacks are built */ export var useInfinitePaginationContext = function () { return useContext(InfinitePaginationContext); }; //# sourceMappingURL=useInfinitePaginationContext.js.map