@bufferapp/async-data-fetch
Advanced tools
Comparing version 2.1.0-beta.3 to 2.1.0
@@ -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) | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
8227
214
1
+ Added@bufferapp/micro-rpc-client@1.5.0(transitive)
+ Addedisomorphic-fetch@3.0.0(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
- Removed@bufferapp/micro-rpc-client@1.0.0(transitive)
- Removedencoding@0.1.13(transitive)
- Removediconv-lite@0.6.3(transitive)
- Removedis-stream@1.1.0(transitive)
- Removedisomorphic-fetch@2.2.1(transitive)
- Removednode-fetch@1.7.3(transitive)
- Removedsafer-buffer@2.1.2(transitive)