react-observable-mixin
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -7,4 +7,2 @@ 'use strict'; | ||
var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })(); | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
@@ -60,10 +58,5 @@ | ||
return Object.keys(props).reduce(function (observables, propKey) { | ||
var _propKey$match = propKey.match(/^(.+)\$$/); | ||
var matches = propKey.match(/^(.+)\$$/); | ||
if (matches && props[propKey] && typeof props[propKey].subscribe === 'function') observables[matches[1]] = props[propKey]; | ||
var _propKey$match2 = _slicedToArray(_propKey$match, 2); | ||
var name = _propKey$match2[1]; | ||
if (name && props[propKey] && typeof props[propKey].subscribe === 'function') observables[name] = props[propKey]; | ||
return observables; | ||
@@ -70,0 +63,0 @@ }, {}); |
{ | ||
"name": "react-observable-mixin", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Container like observable mixin for ReactJS.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -41,9 +41,9 @@ import Rx from 'rx'; | ||
.reduce((observables, propKey) => { | ||
const [, name] = propKey.match(/^(.+)\$$/); | ||
const matches = propKey.match(/^(.+)\$$/); | ||
if ( | ||
name && | ||
matches && | ||
props[propKey] && | ||
typeof props[propKey].subscribe === 'function' | ||
) | ||
observables[name] = props[propKey]; | ||
observables[matches[1]] = props[propKey]; | ||
@@ -50,0 +50,0 @@ return observables; |
@@ -46,3 +46,3 @@ 'use strict'; | ||
const instance = TestUtils.renderIntoDocument( | ||
<Component name$={name$}/> | ||
<Component name$={name$} otherProp="hello"/> | ||
); | ||
@@ -49,0 +49,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
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
1197388
29631