
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
@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 505 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 now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.