Skip to content

@redux-requests/core v1.5.0

Compare
Choose a tag to compare
@klis87 klis87 released this 16 Jan 23:59
· 57 commits to master since this release

Added support for short polling - automatic repeating a given query each defined number of seconds. In details:

  • added meta.poll, which you can add to any of your query, like:
const fetchBooks = () => ({
  type: 'FETCH_BOOKS',
  request: '/books',
  meta: { poll: 10 },
});

which would dispatch fetchBooks every 10 seconds

  • added stopPolling action, with the same signature as abortRequests
  • resetRequests from now on also stops all pollings for relevant query types
  • note that polling doesn't obviously work when ssr: 'server' in handleRequests