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

redux-token-api-middleware

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-token-api-middleware - npm Package Compare versions

Comparing version 0.10.1 to 0.10.2-alpha

18

lib/index.js

@@ -8,2 +8,3 @@ "use strict";

});
exports.createAsyncAction = createAsyncAction;
exports.storeToken = storeToken;

@@ -119,2 +120,8 @@ exports.retrieveToken = retrieveToken;

var ASYNC_OPTIMIST_MAP = {
START: 'BEGIN',
COMPLETED: 'COMMIT',
FAILED: 'REVERT'
};
function createAsyncAction(type, step, payload) {

@@ -136,2 +143,13 @@ var meta = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};

var optimistId = meta.optimistId;
if (optimistId !== undefined) {
Object.assign(action, {
optimist: {
type: ASYNC_OPTIMIST_MAP[step],
id: optimistId
}
});
}
return action;

@@ -138,0 +156,0 @@ }

2

package.json
{
"name": "redux-token-api-middleware",
"version": "0.10.1",
"version": "0.10.2-alpha",
"description": "Redux middleware for calling APIs with token-based auth",

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

@@ -45,3 +45,9 @@ import startsWith from 'lodash.startswith';

function createAsyncAction(type, step, payload, meta = {}) {
const ASYNC_OPTIMIST_MAP = {
START: 'BEGIN',
COMPLETED: 'COMMIT',
FAILED: 'REVERT',
};
export function createAsyncAction(type, step, payload, meta = {}) {
let action = {

@@ -60,2 +66,11 @@ type: `${type}_${step}`,

}
const { optimistId } = meta;
if (optimistId !== undefined) {
Object.assign(action, {
optimist: {
type: ASYNC_OPTIMIST_MAP[step],
id: optimistId,
}
});
}
return action;

@@ -62,0 +77,0 @@ }

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