react-redux-pure
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -21,2 +21,3 @@ "use strict"; | ||
const react_redux_1 = require("react-redux"); | ||
const nameFunction = (name, fn) => new Function(`fn`, `return function ${name}() { return fn.call(this, arguments) };`)(fn); | ||
class PureComponentWrap extends React.PureComponent { | ||
@@ -35,12 +36,13 @@ render() { | ||
return function (state, dispatch, render) { | ||
const f = function PureFunction(props) { | ||
var f = function PureFunction(props) { | ||
return React.createElement(PureComponentWrap, __assign({ _inner: render }, props)); | ||
}; | ||
if (state && !state.name) | ||
Object.defineProperty(state, "name", { get: () => `PureConnect.state(${name})` }); | ||
if (dispatch && !dispatch.name) | ||
Object.defineProperty(dispatch, "name", { get: () => `PureConnect.dispatch(${name})` }); | ||
if (render && !render.name) | ||
Object.defineProperty(render, "name", { get: () => `PureConnect.render(${name})` }); | ||
Object.defineProperty(f, "name", { get: () => `PureConnect(${name})` }); | ||
if (state) | ||
state = nameFunction(`PureConnect_${name}_state`, state); | ||
if (dispatch) | ||
dispatch = nameFunction(`PureConnect_${name}_dispatch`, dispatch); | ||
if (render) | ||
render = nameFunction(`PureConnect_${name}_render`, render); | ||
if (f) | ||
f = nameFunction(`PureConnect_${name}`, f); | ||
return react_redux_1.connect(state, dispatch)(f); | ||
@@ -47,0 +49,0 @@ }; |
{ | ||
"name": "react-redux-pure", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "es6/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
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
119
23585
1