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

@bufferapp/async-data-fetch

Package Overview
Dependencies
Maintainers
32
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bufferapp/async-data-fetch - npm Package Compare versions

Comparing version 2.1.0-beta.3 to 2.1.0

28

lib/index.js

@@ -6,19 +6,24 @@ 'use strict';

});
exports.actionTypes = exports.actions = exports.reducer = exports.customMiddleware = exports.middleware = undefined;
var _middleware2 = require('./middleware');
var _middleware = require('./middleware');
Object.defineProperty(exports, 'customMiddleware', {
Object.defineProperty(exports, 'middleware', {
enumerable: true,
get: function () {
return _middleware2.customMiddleware;
return _interopRequireDefault(_middleware).default;
}
});
var _reducer2 = require('./reducer');
var _reducer = require('./reducer');
Object.defineProperty(exports, 'reducer', {
enumerable: true,
get: function () {
return _interopRequireDefault(_reducer).default;
}
});
Object.defineProperty(exports, 'actions', {
enumerable: true,
get: function () {
return _reducer2.actions;
return _reducer.actions;
}

@@ -29,13 +34,6 @@ });

get: function () {
return _reducer2.actionTypes;
return _reducer.actionTypes;
}
});
var _middleware3 = _interopRequireDefault(_middleware2);
var _reducer3 = _interopRequireDefault(_reducer2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.middleware = _middleware3.default;
exports.reducer = _reducer3.default;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

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

});
exports.customMiddleware = undefined;

@@ -23,6 +22,2 @@ var _microRpcClient = require('@bufferapp/micro-rpc-client');

});
return middleware(store, counter, rpc);
};
function middleware(store, counter, rpc) {
return next => action => {

@@ -42,3 +37,5 @@ next(action);

rpc.call(action.name, args).then(result => store.dispatch(_.actions.fetchSuccess({
rpc.call(action.name, args, {
'x-buffer-client-id': window.xBufferClientId || 'unknown-frontend'
}).then(result => store.dispatch(_.actions.fetchSuccess({
name: action.name,

@@ -63,11 +60,2 @@ args,

};
}
const customMiddleware = exports.customMiddleware = options => store => {
let counter = 0;
const rpc = new _microRpcClient2.default({
url: options.URL,
sendCredentials: options.credentials
});
return middleware(store, counter, rpc);
};
{
"name": "@bufferapp/async-data-fetch",
"version": "2.1.0-beta.3",
"version": "2.1.0",
"description": "Fetch data from RPC backend",

@@ -19,3 +19,3 @@ "main": "lib/index.js",

"dependencies": {
"@bufferapp/micro-rpc-client": "1.0.0"
"@bufferapp/micro-rpc-client": "^1.4.3"
},

@@ -22,0 +22,0 @@ "devDependencies": {

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

export middleware, { customMiddleware } from './middleware'
export reducer, { actions, actionTypes } from './reducer'
export { default as middleware } from './middleware'
export { default as reducer, actions, actionTypes } from './reducer'

@@ -10,6 +10,2 @@ import RPCClient from '@bufferapp/micro-rpc-client'

})
return middleware(store, counter, rpc)
}
function middleware(store, counter, rpc) {
return next => action => {

@@ -31,3 +27,5 @@ next(action)

rpc
.call(action.name, args)
.call(action.name, args, {
'x-buffer-client-id': window.xBufferClientId || 'unknown-frontend',
})
.then(result =>

@@ -44,3 +42,3 @@ store.dispatch(

.catch(error => {
console.error(error); // eslint-disable-line
console.error(error) // eslint-disable-line
store.dispatch(

@@ -62,10 +60,1 @@ actions.fetchFail({

}
export const customMiddleware = options => store => {
let counter = 0
const rpc = new RPCClient({
url: options.URL,
sendCredentials: options.credentials,
})
return middleware(store, counter, rpc)
}
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