react-redux-pure
Advanced tools
Comparing version 0.1.7 to 0.1.8
@@ -1,11 +0,3 @@ | ||
/// <reference types="react" /> | ||
import * as React from 'react'; | ||
export declare const Connect: <TProps>(name: string) => <TState, TActions>(state: (state: any, props?: TProps) => TState, dispatch: (dispatch: any, props?: TProps) => TActions, render: (props: TProps & TState & TActions & { | ||
children?: React.ReactNode; | ||
}) => React.ReactElement<TProps>) => React.StatelessComponent<TProps>; | ||
export declare const PureFunctional: <TProps>(name: string) => (render: (props: TProps & { | ||
children?: React.ReactNode; | ||
}) => React.ReactElement<TProps>) => React.StatelessComponent<TProps>; | ||
export declare const PureConnect: <TProps>(name: string) => <TState, TActions>(state: (state: any, props?: TProps) => TState, dispatch: (dispatch: any, props?: TProps) => TActions, render: (props: TProps & TState & TActions & { | ||
children?: React.ReactNode; | ||
}) => React.ReactElement<TProps>) => React.StatelessComponent<TProps>; | ||
export * from './Connect'; | ||
export * from './PureConnect'; | ||
export * from './PureFunctional'; |
"use strict"; | ||
var __assign = (this && this.__assign) || Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) | ||
t[p[i]] = s[p[i]]; | ||
return t; | ||
}; | ||
const React = require("react"); | ||
const react_redux_1 = require("react-redux"); | ||
const nameFunction = (name, fn) => new Function(`fn`, `return function ${name}() { return fn.apply(this, arguments) };`)(fn); | ||
class PureComponentWrap extends React.PureComponent { | ||
render() { | ||
const _a = this.props, { _inner } = _a, others = __rest(_a, ["_inner"]); | ||
return _inner(others); | ||
} | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
exports.Connect = function (name) { | ||
return function (state, dispatch, render) { | ||
return react_redux_1.connect(state, dispatch)(render); | ||
}; | ||
}; | ||
exports.PureFunctional = function (name) { | ||
return function (render) { | ||
var f = function PureFunction(props) { | ||
return React.createElement(PureComponentWrap, __assign({ _inner: render }, props)); | ||
}; | ||
if (f) | ||
f = nameFunction(`PureFunctional_${name}`, f); | ||
f.displayName = `PureFunctional(${name})`; | ||
return f; | ||
}; | ||
}; | ||
exports.PureConnect = function (name) { | ||
return function (state, dispatch, render) { | ||
var f = function PureFunction(props) { | ||
return React.createElement(PureComponentWrap, __assign({ _inner: render }, props)); | ||
}; | ||
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); | ||
f.displayName = `PureConnect(${name})`; | ||
return react_redux_1.connect(state, dispatch)(f); | ||
}; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./Connect")); | ||
__export(require("./PureConnect")); | ||
__export(require("./PureFunctional")); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "react-redux-pure", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"description": "", | ||
@@ -37,8 +37,8 @@ "main": "es6/index.js", | ||
"devDependencies": { | ||
"@types/react": "^15.0.6", | ||
"react": "^15.4.2", | ||
"react-redux": "^5.0.2", | ||
"redux": "^3.6.0", | ||
"typescript": "^2.1.5" | ||
"@types/react": "^16.7.13", | ||
"react": "^16.6.3", | ||
"react-redux": "^5.1.1", | ||
"redux": "^4.0.1", | ||
"typescript": "^3.2.1" | ||
} | ||
} |
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
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
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
28253
26
203