Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

redux-promise-middleware

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-promise-middleware - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

64

dist/index.js

@@ -12,38 +12,40 @@ 'use strict';

function promiseMiddleware(next) {
return function (action) {
if (!_isPromise2['default'](action.payload)) {
return next(action);
}
function promiseMiddleware() {
return function (next) {
return function (action) {
if (!_isPromise2['default'](action.payload)) {
return next(action);
}
var types = action.types;
var types = action.types;
var promise = action.payload;
var PENDING = types[0];
var FULFILLED = types[1];
var REJECTED = types[2];
var promise = action.payload;
var PENDING = types[0];
var FULFILLED = types[1];
var REJECTED = types[2];
/**
* Dispatch the first async handler. This tells the
* reducer that an async action has been dispatched.
*/
next({
type: PENDING
});
/**
* Dispatch the first async handler. This tells the
* reducer that an async action has been dispatched.
*/
next({
type: PENDING
});
/**
* Return either the fulfilled action object or the rejected
* action object.
*/
return promise.then(function (payload) {
return next({
payload: payload,
type: FULFILLED
/**
* Return either the fulfilled action object or the rejected
* action object.
*/
return promise.then(function (payload) {
return next({
payload: payload,
type: FULFILLED
});
}, function (error) {
return next({
payload: error,
type: REJECTED
});
});
}, function (error) {
return next({
payload: error,
type: REJECTED
});
});
};
};

@@ -50,0 +52,0 @@ }

{
"name": "redux-promise-middleware",
"version": "0.0.1",
"version": "0.1.0",
"description": "Redux middleware for handling promises",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc