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

react-observable-mixin

Package Overview
Dependencies
Maintainers
3
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-observable-mixin - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

35

lib/ObservablePropTypes.js

@@ -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'];

6

lib/RxObservableMixin.js

@@ -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

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