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 4.2.0 to 4.2.1

dist/types.js

17

dist/index.js

@@ -6,2 +6,3 @@ 'use strict';

});
exports.REJECTED = exports.FULFILLED = exports.PENDING = undefined;

@@ -22,4 +23,8 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

var defaultTypes = ['PENDING', 'FULFILLED', 'REJECTED'];
var PENDING = exports.PENDING = 'PENDING';
var FULFILLED = exports.FULFILLED = 'FULFILLED';
var REJECTED = exports.REJECTED = 'REJECTED';
var defaultTypes = [PENDING, FULFILLED, REJECTED];
/**

@@ -57,5 +62,5 @@ * @function promiseMiddleware

var _promiseTypeSuffixes = _slicedToArray(promiseTypeSuffixes, 3),
PENDING = _promiseTypeSuffixes[0],
FULFILLED = _promiseTypeSuffixes[1],
REJECTED = _promiseTypeSuffixes[2];
_PENDING = _promiseTypeSuffixes[0],
_FULFILLED = _promiseTypeSuffixes[1],
_REJECTED = _promiseTypeSuffixes[2];

@@ -73,3 +78,3 @@ /**

return _extends({
type: type + '_' + (isRejected ? REJECTED : FULFILLED)
type: type + '_' + (isRejected ? _REJECTED : _FULFILLED)
}, newPayload === null || typeof newPayload === 'undefined' ? {} : {

@@ -105,3 +110,3 @@ payload: newPayload

next(_extends({
type: type + '_' + PENDING
type: type + '_' + _PENDING
}, data !== undefined ? { payload: data } : {}, meta !== undefined ? { meta: meta } : {}));

@@ -108,0 +113,0 @@

@@ -62,2 +62,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

});
exports.REJECTED = exports.FULFILLED = exports.PENDING = undefined;

@@ -78,4 +79,8 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

var defaultTypes = ['PENDING', 'FULFILLED', 'REJECTED'];
var PENDING = exports.PENDING = 'PENDING';
var FULFILLED = exports.FULFILLED = 'FULFILLED';
var REJECTED = exports.REJECTED = 'REJECTED';
var defaultTypes = [PENDING, FULFILLED, REJECTED];
/**

@@ -113,5 +118,5 @@ * @function promiseMiddleware

var _promiseTypeSuffixes = _slicedToArray(promiseTypeSuffixes, 3),
PENDING = _promiseTypeSuffixes[0],
FULFILLED = _promiseTypeSuffixes[1],
REJECTED = _promiseTypeSuffixes[2];
_PENDING = _promiseTypeSuffixes[0],
_FULFILLED = _promiseTypeSuffixes[1],
_REJECTED = _promiseTypeSuffixes[2];

@@ -129,3 +134,3 @@ /**

return _extends({
type: type + '_' + (isRejected ? REJECTED : FULFILLED)
type: type + '_' + (isRejected ? _REJECTED : _FULFILLED)
}, newPayload === null || typeof newPayload === 'undefined' ? {} : {

@@ -161,3 +166,3 @@ payload: newPayload

next(_extends({
type: type + '_' + PENDING
type: type + '_' + _PENDING
}, data !== undefined ? { payload: data } : {}, meta !== undefined ? { meta: meta } : {}));

@@ -164,0 +169,0 @@

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ReduxPromiseMiddleware=e():t.ReduxPromiseMiddleware=e()}(this,function(){return function(t){function e(r){if(o[r])return o[r].exports;var n=o[r]={exports:{},id:r,loaded:!1};return t[r].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var o={};return e.m=t,e.c=o,e.p="",e(0)}([function(t,e,o){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.promiseTypeSuffixes||y;return function(t){var o=t.dispatch;return function(t){return function(r){if(!r.payload)return t(r);if(!(0,l.default)(r.payload)&&!(0,l.default)(r.payload.promise))return t(r);var n=r.type,a=r.payload,y=r.meta,d=f(e,3),p=d[0],c=d[1],s=d[2],v=function(t,e){return i({type:n+"_"+(e?s:c)},null===t||"undefined"==typeof t?{}:{payload:t},void 0!==y?{meta:y}:{},e?{error:!0}:{})},m=void 0,b=void 0;(0,l.default)(r.payload)||"object"!==u(r.payload)?(m=a,b=void 0):(m=a.promise,b=a.data),t(i({type:n+"_"+p},void 0!==b?{payload:b}:{},void 0!==y?{meta:y}:{}));var h=function(t){var e=v(t,!0);throw o(e),t},x=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=v(t,!1);return o(e),{value:t,action:e}};return m.then(x,h)}}}}Object.defineProperty(e,"__esModule",{value:!0});var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(t[r]=o[r])}return t},f=function(){function t(t,e){var o=[],r=!0,n=!1,u=void 0;try{for(var i,f=t[Symbol.iterator]();!(r=(i=f.next()).done)&&(o.push(i.value),!e||o.length!==e);r=!0);}catch(t){n=!0,u=t}finally{try{!r&&f.return&&f.return()}finally{if(n)throw u}}return o}return function(e,o){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.default=n;var a=o(1),l=r(a),y=["PENDING","FULFILLED","REJECTED"]},function(t,e){"use strict";function o(t){return null!==t&&"object"===("undefined"==typeof t?"undefined":r(t))&&(t&&"function"==typeof t.then)}Object.defineProperty(e,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.default=o}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ReduxPromiseMiddleware=e():t.ReduxPromiseMiddleware=e()}(this,function(){return function(t){function e(r){if(o[r])return o[r].exports;var n=o[r]={exports:{},id:r,loaded:!1};return t[r].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var o={};return e.m=t,e.c=o,e.p="",e(0)}([function(t,e,o){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.promiseTypeSuffixes||c;return function(t){var o=t.dispatch;return function(t){return function(r){if(!r.payload)return t(r);if(!(0,l.default)(r.payload)&&!(0,l.default)(r.payload.promise))return t(r);var n=r.type,a=r.payload,y=r.meta,d=f(e,3),p=d[0],c=d[1],s=d[2],v=function(t,e){return i({type:n+"_"+(e?s:c)},null===t||"undefined"==typeof t?{}:{payload:t},void 0!==y?{meta:y}:{},e?{error:!0}:{})},m=void 0,b=void 0;(0,l.default)(r.payload)||"object"!==u(r.payload)?(m=a,b=void 0):(m=a.promise,b=a.data),t(i({type:n+"_"+p},void 0!==b?{payload:b}:{},void 0!==y?{meta:y}:{}));var E=function(t){var e=v(t,!0);throw o(e),t},h=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=v(t,!1);return o(e),{value:t,action:e}};return m.then(h,E)}}}}Object.defineProperty(e,"__esModule",{value:!0}),e.REJECTED=e.FULFILLED=e.PENDING=void 0;var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(t[r]=o[r])}return t},f=function(){function t(t,e){var o=[],r=!0,n=!1,u=void 0;try{for(var i,f=t[Symbol.iterator]();!(r=(i=f.next()).done)&&(o.push(i.value),!e||o.length!==e);r=!0);}catch(t){n=!0,u=t}finally{try{!r&&f.return&&f.return()}finally{if(n)throw u}}return o}return function(e,o){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.default=n;var a=o(1),l=r(a),y=e.PENDING="PENDING",d=e.FULFILLED="FULFILLED",p=e.REJECTED="REJECTED",c=[y,d,p]},function(t,e){"use strict";function o(t){return null!==t&&"object"===("undefined"==typeof t?"undefined":r(t))&&(t&&"function"==typeof t.then)}Object.defineProperty(e,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.default=o}])});
{
"name": "redux-promise-middleware",
"version": "4.2.0",
"version": "4.2.1",
"description": "Redux middleware for handling promises and optimistic updates",

@@ -74,8 +74,8 @@ "main": "dist/index.js",

"react-dom": "^15.0.0",
"react-redux": "^4.4.1",
"react-router": "^2.0.1",
"react-redux": "5.0.2",
"react-router": "3.0.2",
"redux": "^3.0.4",
"redux-mock-store": "1.2.1",
"redux-mock-store": "^1.2.2",
"redux-thunk": "^2.0.1",
"sinon": "^1.17.2",
"sinon": "^1.17.6",
"sinon-chai": "^2.8.0",

@@ -82,0 +82,0 @@ "webpack": "^1.12.14",

# Redux Promise Middleware
[![npm version](https://img.shields.io/npm/v/redux-promise-middleware.svg?style=flat)](https://www.npmjs.com/package/redux-promise-middleware) [![Build Status](https://travis-ci.org/pburtchaell/redux-promise-middleware.svg?branch=master)](https://travis-ci.org/pburtchaell/redux-promise-middleware) [![Coverage Status](https://coveralls.io/repos/pburtchaell/redux-promise-middleware/badge.svg?branch=master&service=github)](https://coveralls.io/github/pburtchaell/redux-promise-middleware?branch=master) [![npm downloads](https://img.shields.io/npm/dm/redux-promise-middleware.svg?style=flat)](https://www.npmjs.com/package/redux-promise-middleware)
[![npm version](https://img.shields.io/npm/v/redux-promise-middleware.svg?style=flat)](https://www.npmjs.com/package/redux-promise-middleware) [![Build Status](https://travis-ci.org/pburtchaell/redux-promise-middleware.svg?branch=master)](https://travis-ci.org/pburtchaell/redux-promise-middleware) [![npm downloads](https://img.shields.io/npm/dm/redux-promise-middleware.svg?style=flat)](https://www.npmjs.com/package/redux-promise-middleware)

@@ -9,4 +9,4 @@ Redux promise middleware enables robust handling of async code in [Redux](http://redux.js.org). The middleware enables optimistic updates and dispatches pending, fulfilled and rejected actions. It can be combined with [redux-thunk](https://github.com/gaearon/redux-thunk) to chain async actions. If you are curious to see how the middleware works, [browse the source code](https://sourcegraph.com/github.com/pburtchaell/redux-promise-middleware/-/blob/src/index.js) on Sourcegraph!

- [Introduction](/docs/introduction.md)
- [Guides](/docs/guides/)
- [Introduction](/docs/introduction.md)
- [Examples](/examples)

@@ -22,3 +22,7 @@ - [Releases](https://github.com/pburtchaell/redux-promise-middleware/releases)

## Sponsor
To help cover the cost of my time spent maintaining open source software (OSS) projects, **I'm looking for a small sponsor.** If your company is interested, [send me an email](mailto:patrick@pburtchaell.com) and we can chat! If you like my code and you're interested in buying me a drink, I have a [Gratipay](https://gratipay.com/~pburtchaell/). Thanks! I greatly appreciate your support and I'm grateful to be a part of the OSS and GitHub community.
---
Copyright (c) 2015 Patrick Burtchaell. [Licensed with The MIT License (MIT)](https://raw.githubusercontent.com/pburtchaell/redux-promise-middleware/master/LICENSE). [Gratipay](https://gratipay.com/~pburtchaell/).

@@ -191,3 +191,1 @@ # 3.x to 4.0.0

```
If you have questions, please feel free to create an issue on GitHub. All changes are [further documented](https://github.com/pburtchaell/redux-promise-middleware/tree/master/docs).

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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