zeriontech/defi-sdk-js

onAnyMessage callback called more than once for paginated hooks

everdimension opened this issue · 0 comments

Code example:

  const entry = useAddressActions(
    {
      ...params,
      currency: 'usd',
      actions_search_query: searchQuery,
    },
    {
      limit: 30,
      listenForUpdates: true,
      paginatedCacheMode: 'first-page',
      onAnyMessage: useCallback((a, b, c) => {
        console.log('onAnyMessage', { a, b, c }); // this is called more than once for each item
      }, []),
    }
  );

It's called twice for each item for first "page" and then increases for each next page load.