@redux-requests/core v1.5.0
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 asabortRequests
resetRequests
from now on also stops all pollings for relevant query types- note that polling doesn't obviously work when
ssr: 'server'
inhandleRequests