Declarative AJAX requests and automatic network state management for single-page applications
MIT License
Bot releases are visible (Hide)
Removed axios dependency, which became problematic for recent axios version. Thanks @klausbreyer for reporting the issue.
Published by klis87 almost 3 years ago
Updated Typescript types to support strict
mode. Thank you @medfreeman for this awesome contribution!
Published by klis87 almost 3 years ago
Updated Typescript types to support strict
mode. Thank you @medfreeman for this awesome contribution!
Published by klis87 almost 3 years ago
Fixed fetch
driver so that it is compatible with abort actions. Previously aborts indeed worked, but error
action was dispatched instead of abort
. Thank you @medfreeman for noticing this issue and solving it!
Published by klis87 about 3 years ago
Updated TypeScript type for useQuery
- now data
type from passed action
or type
will be inferred as data | null
, which will be correctly handle cases where data
hasn't been loaded yet. Thanks @fmmoret !
Published by klis87 over 3 years ago
Fixed useQuery
load
callback when autoLoad
is false
.
Published by klis87 over 3 years ago
A small subscription bug fix - now messages from the client to the server are not sent if websocket connection is opening. Instead, it is ignored and will be sent just once connection is established.
Published by klis87 over 3 years ago
Added useSubscription
. See https://redux-requests.klisiczynski.com/docs/guides/usage-with-react#usesubscription
Published by klis87 over 3 years ago
Added createSubscriber
to allow graphql subscriptions with apollo-server. See https://redux-requests.klisiczynski.com/docs/drivers/graphql-driver#subscriptions
Published by klis87 over 3 years ago
Added subscriptions, see https://redux-requests.klisiczynski.com/docs/api-reference/subscription-action and https://redux-requests.klisiczynski.com/docs/api-reference/handle-requests#subscriber for details.
Published by klis87 almost 4 years ago
Small useQuery
update - useQuery
response object also contains stopPolling
memoized callback for convenience.
Published by klis87 almost 4 years ago
Added support for short polling - automatic repeating a given query each defined number of seconds. In details:
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
stopPolling
action, with the same signature as abortRequests
resetRequests
from now on also stops all pollings for relevant query typesssr: 'server'
in handleRequests
Published by klis87 almost 4 years ago
This is a very big release, no backward changes but many new features:
useQuery
and useMutation
got many new props, allowing to get auto fetching, auto resetting, suspense support, SSR suspense, throwing errors to catch by error boundaryRequestsProvider
component, which allows to change defaults for hooks and can setup Redux store for you optionallyRequestsErrorBoundary
helperSee https://redux-requests.klisiczynski.com/docs/guides/usage-with-react for details
Published by klis87 almost 4 years ago
This release added mostly several things which were needed for new version of React bindings:
joinRequest
action, so that you can attach to a pending request and get its response promiseresetRequests
not to reset cached queriesaddWatcher
and removeWatcher
actions - those are probably needed only for UI bindings like React internallydisableRequestsPromise
option to handleRequest
, for now probably useful only with new suspense SSR mode for ReactPublished by klis87 almost 4 years ago
Added support for tracking download and upload progress. See release for core 1.3.0.
Published by klis87 almost 4 years ago
Added support for tracking download and upload progress. See release for core 1.3.0.
Published by klis87 almost 4 years ago
Added support for tracking download and upload progress. See release for core 1.3.0.
Published by klis87 almost 4 years ago
Added support for tracking download and upload progress. For now available only for axios
and graphql
drivers. Also, due to complexity, for now batched requests are not supported, albeit this is a very rare edge case anyway. How to use it? Just add meta.measureDownloadProgress
or meta.measureUploadProgress
to your actions and read downloadProgress
and uploadProgress
from any selectors! Thanks @iwan-uschka for this brilliant idea!
Published by klis87 almost 4 years ago
Added useDispatchRequest
hook - this is just an alias for useDispatch
from react-redux
, but with a better Typescript typing.
You could learn all details here.
Published by klis87 almost 4 years ago
Typescript related additions:
LocalMutationAction
interfacecreateRequestsStore
function to decorate store
with dispatchRequest
method - alias for dispatch
but with better typingsRequestsStore
passed instead of normal store, the only difference is that you get an access to dispatchRequest
methodaction
prop to getQuery
and getQuerySelector
to automatically infer data
genericResponseData
utility typeYou could learn all details in docs.