
Product
Announcing Precomputed Reachability Analysis in Socket
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
@redux-requests/promise
Advanced tools
Promise driver for Redux-Requests, Redux addon to simplify AJAX requests
Promise driver to Redux - addon to simplify handling of AJAX requests.
To install the package, just run:
$ npm install @redux-requests/promise
This driver is useful, when you use an API library, which use promises.
For instance, you could do something like that:
import { createDriver } from '@redux-requests/promise';
handleRequests({
driver: createDriver({
AbortController: window.AbortController,
processResponse: response => ({ data: response }),
}),
});
const fetchPhoto = id => ({
type: FETCH_PHOTO,
request: {
promise: axios.get(`https://jsonplaceholder.typicode.com/photos/${id}`),
},
});
AbortController
is optional, by default is will use AbortController
is available,
with fallback to DummyAbortController
which does nothing. If your invironment doesn't
support AbortController
, you could pass a polyfill.
If you don't, requests abort won't work.
processResponse
is also optional, the default is response => ({ data: response })
,
it is useful if your promises resolve to more things than data
, then you could for instance use
response => ({ data: response.data })
For usage, see redux-saga-requests docs.
Also note, that for mutations you need to pass meta.asMutation: true
in your request actions,
so core library could know whether a request is a query or a mutation.
MIT
FAQs
Promise driver for redux-requests, declarative AJAX requests and automatic network state management for single-page applications
The npm package @redux-requests/promise receives a total of 699 weekly downloads. As such, @redux-requests/promise popularity was classified as not popular.
We found that @redux-requests/promise demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.