boxed-injector-react
Advanced tools
Comparing version 0.0.1 to 0.0.2
'use strict'; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var Inject = function Inject(React) { | ||
@@ -14,7 +22,20 @@ return function (injector) { | ||
} | ||
return React.createClass({ | ||
render: function render() { | ||
return React.createElement(target, Object.assign({}, this.props, props)); | ||
return function (_React$Component) { | ||
_inherits(InjectComponent, _React$Component); | ||
function InjectComponent() { | ||
_classCallCheck(this, InjectComponent); | ||
return _possibleConstructorReturn(this, (InjectComponent.__proto__ || Object.getPrototypeOf(InjectComponent)).apply(this, arguments)); | ||
} | ||
}); | ||
_createClass(InjectComponent, [{ | ||
key: 'render', | ||
value: function render() { | ||
return React.createElement(target, Object.assign({}, this.props, props)); | ||
} | ||
}]); | ||
return InjectComponent; | ||
}(React.Component); | ||
}; | ||
@@ -21,0 +42,0 @@ }; |
'use strict'; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var Injectable = function Injectable(React) { | ||
return function (Component, props) { | ||
return React.createClass({ | ||
render: function render() { | ||
return React.createElement(Component, Object.assign({}, this.props, props)); | ||
return function (_React$Component) { | ||
_inherits(InjectableComponent, _React$Component); | ||
function InjectableComponent() { | ||
_classCallCheck(this, InjectableComponent); | ||
return _possibleConstructorReturn(this, (InjectableComponent.__proto__ || Object.getPrototypeOf(InjectableComponent)).apply(this, arguments)); | ||
} | ||
}); | ||
_createClass(InjectableComponent, [{ | ||
key: 'render', | ||
value: function render() { | ||
return React.createElement(Component, Object.assign({}, this.props, props)); | ||
} | ||
}]); | ||
return InjectableComponent; | ||
}(React.Component); | ||
}; | ||
@@ -12,0 +33,0 @@ }; |
{ | ||
"name": "boxed-injector-react", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Dependency Injection Tools for React", | ||
@@ -5,0 +5,0 @@ "homepage": "", |
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
17587
194
1