react-observable-mixin
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -9,9 +9,34 @@ 'use strict'; | ||
var _rx = require('rx'); | ||
var _rxLite = require('rx-lite'); | ||
var _rx2 = _interopRequireDefault(_rx); | ||
var _rxLite2 = _interopRequireDefault(_rxLite); | ||
var _react = require('react'); | ||
var ANONYMOUS = '<<anonymous>>'; | ||
/** | ||
* Create a chainable type checker. | ||
* | ||
* @param {func} validate | ||
*/ | ||
function createChainableTypeChecker(validate) { | ||
function checkType(isRequired, props, propName, componentName, location) { | ||
componentName = componentName || ANONYMOUS; | ||
if (props[propName] == null) { | ||
var locationName = location; | ||
if (isRequired) { | ||
return new Error('Required ' + locationName + ' `' + propName + '` was not specified in ' + ('`' + componentName + '`.')); | ||
} | ||
} else { | ||
return validate(props, propName, componentName, location); | ||
} | ||
} | ||
var chainedCheckType = checkType.bind(null, false); | ||
chainedCheckType.isRequired = checkType.bind(null, true); | ||
return chainedCheckType; | ||
} | ||
/** | ||
* Observable prop type. | ||
@@ -22,5 +47,7 @@ * | ||
var observable = _react.PropTypes.instanceOf(_rx2['default'].Observable); | ||
var observable = createChainableTypeChecker(function (props, propName, componentName) { | ||
if (!_rxLite2['default'].Observable.isObservable(props[propName])) throw new Error('\n Prop `' + propName + '` specified in `' + componentName + '`\n is not a valid observable.\n '); | ||
}); | ||
exports['default'] = { observable: observable }; | ||
module.exports = exports['default']; |
@@ -13,5 +13,5 @@ 'use strict'; | ||
var _rx = require('rx'); | ||
var _rxLite = require('rx-lite'); | ||
var _rx2 = _interopRequireDefault(_rx); | ||
var _rxLite2 = _interopRequireDefault(_rxLite); | ||
@@ -105,3 +105,3 @@ var _shallowequal = require('shallowequal'); | ||
this.observablesSubscription = _rx2['default'].Observable.combineLatest(mapObservables, function () { | ||
this.observablesSubscription = _rxLite2['default'].Observable.combineLatest(mapObservables, function () { | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
@@ -108,0 +108,0 @@ args[_key] = arguments[_key]; |
{ | ||
"name": "react-observable-mixin", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Container like observable mixin for ReactJS.", | ||
@@ -10,2 +10,3 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"rx-lite": "^4.0.6", | ||
"shallowequal": "^0.2.2" | ||
@@ -40,3 +41,2 @@ }, | ||
"react-pure-render": "^1.0.2", | ||
"rx": "^4.0.6", | ||
"sinon": "^1.17.1", | ||
@@ -43,0 +43,0 @@ "sinon-chai": "^2.8.0", |
Sorry, the diff of this file is too big to display
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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
30
1020387
2
24752
3
2
+ Addedrx-lite@^4.0.6
+ Addedrx-lite@4.0.8(transitive)