recompose
Advanced tools
Comparing version 0.26.0 to 0.27.0
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
@@ -5,0 +7,0 @@ var _symbolObservable = require('symbol-observable'); |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
@@ -5,0 +7,0 @@ var _react = require('react'); |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
@@ -5,0 +7,0 @@ var _react = require('react'); |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.componentFromStreamWithConfig = undefined; | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _react = require('react'); | ||
@@ -18,12 +32,6 @@ | ||
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 componentFromStreamWithConfig = exports.componentFromStreamWithConfig = function componentFromStreamWithConfig(config) { | ||
return function (propsToVdom) { | ||
return function (_Component) { | ||
_inherits(ComponentFromStream, _Component); | ||
(0, _inherits3.default)(ComponentFromStream, _Component); | ||
@@ -35,3 +43,3 @@ function ComponentFromStream() { | ||
_classCallCheck(this, ComponentFromStream); | ||
(0, _classCallCheck3.default)(this, ComponentFromStream); | ||
@@ -42,3 +50,3 @@ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.state = { vdom: null }, _this.propsEmitter = (0, _changeEmitter.createChangeEmitter)(), _this.props$ = config.fromESObservable((_config$fromESObserva = { | ||
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.state = { vdom: null }, _this.propsEmitter = (0, _changeEmitter.createChangeEmitter)(), _this.props$ = config.fromESObservable((_config$fromESObserva = { | ||
subscribe: function subscribe(observer) { | ||
@@ -56,3 +64,3 @@ var unsubscribe = _this.propsEmitter.listen(function (props) { | ||
return this; | ||
}, _config$fromESObserva)), _this.vdom$ = config.toESObservable(propsToVdom(_this.props$)), _temp), _possibleConstructorReturn(_this, _ret); | ||
}, _config$fromESObserva)), _this.vdom$ = config.toESObservable(propsToVdom(_this.props$)), _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | ||
} | ||
@@ -59,0 +67,0 @@ |
"use strict"; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = compose; | ||
@@ -5,0 +7,0 @@ function compose() { |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.createEventHandlerWithConfig = undefined; | ||
@@ -5,0 +7,0 @@ |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _react = require('react'); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var _reactLifecyclesCompat = require('react-lifecycles-compat'); | ||
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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
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 createSink = function createSink(callback) { | ||
return function (_Component) { | ||
_inherits(Sink, _Component); | ||
var Sink = function (_Component) { | ||
(0, _inherits3.default)(Sink, _Component); | ||
function Sink() { | ||
_classCallCheck(this, Sink); | ||
var _temp, _this, _ret; | ||
return _possibleConstructorReturn(this, _Component.apply(this, arguments)); | ||
(0, _classCallCheck3.default)(this, Sink); | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.state = {}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | ||
} | ||
Sink.prototype.componentWillMount = function componentWillMount() { | ||
callback(this.props); | ||
}; | ||
Sink.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { | ||
Sink.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps) { | ||
callback(nextProps); | ||
return null; | ||
}; | ||
@@ -37,4 +52,7 @@ | ||
}(_react.Component); | ||
(0, _reactLifecyclesCompat.polyfill)(Sink); | ||
return Sink; | ||
}; | ||
exports.default = createSink; |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
@@ -5,0 +7,0 @@ var _react = require('react'); |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
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; }; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _react = require('react'); | ||
@@ -23,3 +27,3 @@ | ||
var FlattenProp = function FlattenProp(props) { | ||
return factory(_extends({}, props, props[propName])); | ||
return factory((0, _extends3.default)({}, props, props[propName])); | ||
}; | ||
@@ -26,0 +30,0 @@ |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
@@ -5,0 +7,0 @@ var _symbolObservable = require('symbol-observable'); |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
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; }; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _react = require('react'); | ||
@@ -23,3 +27,3 @@ | ||
var GetContext = function GetContext(ownerProps, context) { | ||
return factory(_extends({}, ownerProps, context)); | ||
return factory((0, _extends3.default)({}, ownerProps, context)); | ||
}; | ||
@@ -26,0 +30,0 @@ |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var getDisplayName = function getDisplayName(Component) { | ||
@@ -5,0 +7,0 @@ if (typeof Component === 'string') { |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
@@ -11,6 +13,6 @@ var _hoistNonReactStatics = require('hoist-non-react-statics'); | ||
var hoistStatics = function hoistStatics(higherOrderComponent) { | ||
var hoistStatics = function hoistStatics(higherOrderComponent, blacklist) { | ||
return function (BaseComponent) { | ||
var NewComponent = higherOrderComponent(BaseComponent); | ||
(0, _hoistNonReactStatics2.default)(NewComponent, BaseComponent); | ||
(0, _hoistNonReactStatics2.default)(NewComponent, BaseComponent, blacklist); | ||
return NewComponent; | ||
@@ -17,0 +19,0 @@ }; |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
@@ -5,0 +7,0 @@ var _mapProps = require('./mapProps'); |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var isClassComponent = function isClassComponent(Component) { | ||
@@ -5,0 +7,0 @@ return Boolean(Component && Component.prototype && typeof Component.prototype.render === 'function'); |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
@@ -5,0 +7,0 @@ var _kefir = require('kefir'); |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
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; }; | ||
var _keys = require('babel-runtime/core-js/object/keys'); | ||
var _keys2 = _interopRequireDefault(_keys); | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _react = require('react'); | ||
@@ -19,9 +39,2 @@ | ||
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; } /* eslint-disable no-console */ | ||
var lifecycle = function lifecycle(spec) { | ||
@@ -36,12 +49,11 @@ return function (BaseComponent) { | ||
var Lifecycle = function (_Component) { | ||
_inherits(Lifecycle, _Component); | ||
(0, _inherits3.default)(Lifecycle, _Component); | ||
function Lifecycle() { | ||
_classCallCheck(this, Lifecycle); | ||
return _possibleConstructorReturn(this, _Component.apply(this, arguments)); | ||
(0, _classCallCheck3.default)(this, Lifecycle); | ||
return (0, _possibleConstructorReturn3.default)(this, _Component.apply(this, arguments)); | ||
} | ||
Lifecycle.prototype.render = function render() { | ||
return factory(_extends({}, this.props, this.state)); | ||
return factory((0, _extends3.default)({}, this.props, this.state)); | ||
}; | ||
@@ -52,3 +64,3 @@ | ||
Object.keys(spec).forEach(function (hook) { | ||
(0, _keys2.default)(spec).forEach(function (hook) { | ||
return Lifecycle.prototype[hook] = spec[hook]; | ||
@@ -62,4 +74,3 @@ }); | ||
}; | ||
}; | ||
}; /* eslint-disable no-console */ | ||
exports.default = lifecycle; |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
@@ -5,0 +7,0 @@ var _react = require('react'); |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.mapPropsStreamWithConfig = undefined; | ||
@@ -5,0 +7,0 @@ |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
@@ -5,0 +7,0 @@ var _most = require('most'); |
15
nest.js
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties'); | ||
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | ||
var _react = require('react'); | ||
@@ -13,4 +19,2 @@ | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
var nest = function nest() { | ||
@@ -23,5 +27,4 @@ for (var _len = arguments.length, Components = Array(_len), _key = 0; _key < _len; _key++) { | ||
var Nest = function Nest(_ref) { | ||
var props = _objectWithoutProperties(_ref, []), | ||
children = _ref.children; | ||
var children = _ref.children, | ||
props = (0, _objectWithoutProperties3.default)(_ref, ['children']); | ||
return factories.reduceRight(function (child, factory) { | ||
@@ -28,0 +31,0 @@ return factory(props, child); |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
@@ -5,0 +7,0 @@ var _shouldUpdate = require('./shouldUpdate'); |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _keys = require('babel-runtime/core-js/object/keys'); | ||
var _keys2 = _interopRequireDefault(_keys); | ||
var _onlyUpdateForKeys = require('./onlyUpdateForKeys'); | ||
@@ -34,3 +40,3 @@ | ||
var propKeys = Object.keys(propTypes || {}); | ||
var propKeys = (0, _keys2.default)(propTypes || {}); | ||
var OnlyUpdateForPropTypes = (0, _onlyUpdateForKeys2.default)(propKeys)(BaseComponent); | ||
@@ -37,0 +43,0 @@ |
{ | ||
"name": "recompose", | ||
"version": "0.26.0", | ||
"version": "0.27.0", | ||
"author": "Andrew Clark <acdlite@me.com>", | ||
@@ -24,8 +24,10 @@ "repository": { | ||
], | ||
"main": "cjs/Recompose.js", | ||
"module": "es/Recompose.js", | ||
"main": "dist/Recompose.cjs.js", | ||
"module": "dist/Recompose.esm.js", | ||
"dependencies": { | ||
"babel-runtime": "^6.26.0", | ||
"change-emitter": "^0.1.2", | ||
"fbjs": "^0.8.1", | ||
"hoist-non-react-statics": "^2.3.1", | ||
"react-lifecycles-compat": "^3.0.2", | ||
"symbol-observable": "^1.0.4" | ||
@@ -32,0 +34,0 @@ }, |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
@@ -5,0 +7,0 @@ var _shouldUpdate = require('./shouldUpdate'); |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
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; }; | ||
var _extends3 = require('babel-runtime/helpers/extends'); | ||
var _extends4 = _interopRequireDefault(_extends3); | ||
var _omit = require('./utils/omit'); | ||
@@ -29,3 +33,3 @@ | ||
return _extends({}, (0, _omit2.default)(props, [oldName]), (_extends2 = {}, _extends2[newName] = props[oldName], _extends2)); | ||
return (0, _extends4.default)({}, (0, _omit2.default)(props, [oldName]), (_extends2 = {}, _extends2[newName] = props[oldName], _extends2)); | ||
}); | ||
@@ -32,0 +36,0 @@ if (process.env.NODE_ENV !== 'production') { |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
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; }; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _keys = require('babel-runtime/core-js/object/keys'); | ||
var _keys2 = _interopRequireDefault(_keys); | ||
var _omit = require('./utils/omit'); | ||
@@ -29,3 +37,3 @@ | ||
var keys = Object.keys; | ||
var keys = _keys2.default; | ||
@@ -45,3 +53,3 @@ | ||
var hoc = (0, _mapProps2.default)(function (props) { | ||
return _extends({}, (0, _omit2.default)(props, keys(nameMap)), mapKeys((0, _pick2.default)(props, keys(nameMap)), function (_, oldName) { | ||
return (0, _extends3.default)({}, (0, _omit2.default)(props, keys(nameMap)), mapKeys((0, _pick2.default)(props, keys(nameMap)), function (_, oldName) { | ||
return nameMap[oldName]; | ||
@@ -48,0 +56,0 @@ })); |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
@@ -5,0 +7,0 @@ var _react = require('react'); |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _react = require('react'); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
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; } | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
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 _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _react = require('react'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var Nothing = function (_Component) { | ||
_inherits(Nothing, _Component); | ||
(0, _inherits3.default)(Nothing, _Component); | ||
function Nothing() { | ||
_classCallCheck(this, Nothing); | ||
return _possibleConstructorReturn(this, _Component.apply(this, arguments)); | ||
(0, _classCallCheck3.default)(this, Nothing); | ||
return (0, _possibleConstructorReturn3.default)(this, _Component.apply(this, arguments)); | ||
} | ||
@@ -21,0 +30,0 @@ |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
@@ -5,0 +7,0 @@ var _symbolObservable = require('symbol-observable'); |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
@@ -5,0 +7,0 @@ var _rxjs = require('rxjs'); |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
@@ -5,0 +7,0 @@ var _setStatic = require('./setStatic'); |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _config = { | ||
@@ -5,0 +7,0 @@ fromESObservable: null, |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
@@ -5,0 +7,0 @@ var _setStatic = require('./setStatic'); |
"use strict"; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var setStatic = function setStatic(key, value) { | ||
@@ -5,0 +7,0 @@ return function (BaseComponent) { |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
@@ -5,0 +7,0 @@ var _shallowEqual = require('fbjs/lib/shallowEqual'); |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _react = require('react'); | ||
@@ -17,8 +31,2 @@ | ||
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 shouldUpdate = function shouldUpdate(test) { | ||
@@ -29,8 +37,7 @@ return function (BaseComponent) { | ||
var ShouldUpdate = function (_Component) { | ||
_inherits(ShouldUpdate, _Component); | ||
(0, _inherits3.default)(ShouldUpdate, _Component); | ||
function ShouldUpdate() { | ||
_classCallCheck(this, ShouldUpdate); | ||
return _possibleConstructorReturn(this, _Component.apply(this, arguments)); | ||
(0, _classCallCheck3.default)(this, ShouldUpdate); | ||
return (0, _possibleConstructorReturn3.default)(this, _Component.apply(this, arguments)); | ||
} | ||
@@ -37,0 +44,0 @@ |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _react = require('react'); | ||
@@ -19,20 +33,11 @@ | ||
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 toClass = function toClass(baseComponent) { | ||
if ((0, _isClassComponent2.default)(baseComponent)) { | ||
return baseComponent; | ||
} | ||
var _class, _temp; | ||
var ToClass = function (_Component) { | ||
_inherits(ToClass, _Component); | ||
return (0, _isClassComponent2.default)(baseComponent) ? baseComponent : (_temp = _class = function (_Component) { | ||
(0, _inherits3.default)(ToClass, _Component); | ||
function ToClass() { | ||
_classCallCheck(this, ToClass); | ||
return _possibleConstructorReturn(this, _Component.apply(this, arguments)); | ||
(0, _classCallCheck3.default)(this, ToClass); | ||
return (0, _possibleConstructorReturn3.default)(this, _Component.apply(this, arguments)); | ||
} | ||
@@ -48,12 +53,4 @@ | ||
return ToClass; | ||
}(_react.Component); | ||
ToClass.displayName = (0, _getDisplayName2.default)(baseComponent); | ||
ToClass.propTypes = baseComponent.propTypes; | ||
ToClass.contextTypes = baseComponent.contextTypes; | ||
ToClass.defaultProps = baseComponent.defaultProps; | ||
return ToClass; | ||
}(_react.Component), _class.displayName = (0, _getDisplayName2.default)(baseComponent), _class.propTypes = baseComponent.propTypes, _class.contextTypes = baseComponent.contextTypes, _class.defaultProps = baseComponent.defaultProps, _temp); | ||
}; | ||
exports.default = toClass; |
"use strict"; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var mapValues = function mapValues(obj, func) { | ||
@@ -5,0 +7,0 @@ var result = {}; |
"use strict"; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
var _objectWithoutProperties2 = require("babel-runtime/helpers/objectWithoutProperties"); | ||
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var omit = function omit(obj, keys) { | ||
var rest = _objectWithoutProperties(obj, []); | ||
var rest = (0, _objectWithoutProperties3.default)(obj, []); | ||
@@ -10,0 +16,0 @@ for (var i = 0; i < keys.length; i++) { |
"use strict"; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var pick = function pick(obj, keys) { | ||
@@ -5,0 +7,0 @@ var result = {}; |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _react = require('react'); | ||
@@ -17,8 +31,2 @@ | ||
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 withContext = function withContext(childContextTypes, getChildContext) { | ||
@@ -29,3 +37,3 @@ return function (BaseComponent) { | ||
var WithContext = function (_Component) { | ||
_inherits(WithContext, _Component); | ||
(0, _inherits3.default)(WithContext, _Component); | ||
@@ -35,3 +43,3 @@ function WithContext() { | ||
_classCallCheck(this, WithContext); | ||
(0, _classCallCheck3.default)(this, WithContext); | ||
@@ -42,5 +50,5 @@ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.getChildContext = function () { | ||
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.getChildContext = function () { | ||
return getChildContext(_this.props); | ||
}, _temp), _possibleConstructorReturn(_this, _ret); | ||
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | ||
} | ||
@@ -47,0 +55,0 @@ |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
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; }; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _react = require('react'); | ||
@@ -23,9 +39,3 @@ | ||
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; } /* eslint-disable no-console */ | ||
/* eslint-disable no-console */ | ||
var withHandlers = function withHandlers(handlers) { | ||
@@ -36,3 +46,3 @@ return function (BaseComponent) { | ||
var WithHandlers = function (_Component) { | ||
_inherits(WithHandlers, _Component); | ||
(0, _inherits3.default)(WithHandlers, _Component); | ||
@@ -42,3 +52,3 @@ function WithHandlers() { | ||
_classCallCheck(this, WithHandlers); | ||
(0, _classCallCheck3.default)(this, WithHandlers); | ||
@@ -49,11 +59,7 @@ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _initialiseProps.call(_this), _temp), _possibleConstructorReturn(_this, _ret); | ||
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, _Component.call.apply(_Component, [this].concat(args))), _this), _initialiseProps.call(_this), _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | ||
} | ||
WithHandlers.prototype.componentWillReceiveProps = function componentWillReceiveProps() { | ||
this.cachedHandlers = {}; | ||
}; | ||
WithHandlers.prototype.render = function render() { | ||
return factory(_extends({}, this.props, this.handlers)); | ||
return factory((0, _extends3.default)({}, this.props, this.handlers)); | ||
}; | ||
@@ -67,12 +73,5 @@ | ||
this.cachedHandlers = {}; | ||
this.handlers = (0, _mapValues2.default)(typeof handlers === 'function' ? handlers(this.props) : handlers, function (createHandler, handlerName) { | ||
this.handlers = (0, _mapValues2.default)(typeof handlers === 'function' ? handlers(this.props) : handlers, function (createHandler) { | ||
return function () { | ||
var cachedHandler = _this2.cachedHandlers[handlerName]; | ||
if (cachedHandler) { | ||
return cachedHandler.apply(undefined, arguments); | ||
} | ||
var handler = createHandler(_this2.props); | ||
_this2.cachedHandlers[handlerName] = handler; | ||
@@ -79,0 +78,0 @@ if (process.env.NODE_ENV !== 'production' && typeof handler !== 'function') { |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
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; }; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _wrapDisplayName = require('./wrapDisplayName'); | ||
@@ -23,3 +27,3 @@ | ||
var hoc = (0, _mapProps2.default)(function (props) { | ||
return _extends({}, props, typeof input === 'function' ? input(props) : input); | ||
return (0, _extends3.default)({}, props, typeof input === 'function' ? input(props) : input); | ||
}); | ||
@@ -26,0 +30,0 @@ if (process.env.NODE_ENV !== 'production') { |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
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; }; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _react = require('react'); | ||
var _reactLifecyclesCompat = require('react-lifecycles-compat'); | ||
var _pick = require('./utils/pick'); | ||
@@ -27,8 +45,2 @@ | ||
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 withPropsOnChange = function withPropsOnChange(shouldMapOrKeys, propsMapper) { | ||
@@ -42,3 +54,3 @@ return function (BaseComponent) { | ||
var WithPropsOnChange = function (_Component) { | ||
_inherits(WithPropsOnChange, _Component); | ||
(0, _inherits3.default)(WithPropsOnChange, _Component); | ||
@@ -48,3 +60,3 @@ function WithPropsOnChange() { | ||
_classCallCheck(this, WithPropsOnChange); | ||
(0, _classCallCheck3.default)(this, WithPropsOnChange); | ||
@@ -55,13 +67,21 @@ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.computedProps = propsMapper(_this.props), _temp), _possibleConstructorReturn(_this, _ret); | ||
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.state = { | ||
computedProps: propsMapper(_this.props), | ||
prevProps: _this.props | ||
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | ||
} | ||
WithPropsOnChange.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { | ||
if (shouldMap(this.props, nextProps)) { | ||
this.computedProps = propsMapper(nextProps); | ||
WithPropsOnChange.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) { | ||
if (shouldMap(prevState.prevProps, nextProps)) { | ||
return { | ||
computedProps: propsMapper(nextProps), | ||
prevProps: nextProps | ||
}; | ||
} | ||
return null; | ||
}; | ||
WithPropsOnChange.prototype.render = function render() { | ||
return factory(_extends({}, this.props, this.computedProps)); | ||
return factory((0, _extends3.default)({}, this.props, this.state.computedProps)); | ||
}; | ||
@@ -72,5 +92,8 @@ | ||
(0, _reactLifecyclesCompat.polyfill)(WithPropsOnChange); | ||
if (process.env.NODE_ENV !== 'production') { | ||
return (0, _setDisplayName2.default)((0, _wrapDisplayName2.default)(BaseComponent, 'withPropsOnChange'))(WithPropsOnChange); | ||
} | ||
return WithPropsOnChange; | ||
@@ -77,0 +100,0 @@ }; |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
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; }; | ||
var _extends3 = require('babel-runtime/helpers/extends'); | ||
var _extends4 = _interopRequireDefault(_extends3); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _react = require('react'); | ||
@@ -19,8 +35,4 @@ | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var noop = function noop() {}; | ||
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 withReducer = function withReducer(stateName, dispatchName, reducer, initialState) { | ||
@@ -31,3 +43,3 @@ return function (BaseComponent) { | ||
var WithReducer = function (_Component) { | ||
_inherits(WithReducer, _Component); | ||
(0, _inherits3.default)(WithReducer, _Component); | ||
@@ -37,3 +49,3 @@ function WithReducer() { | ||
_classCallCheck(this, WithReducer); | ||
(0, _classCallCheck3.default)(this, WithReducer); | ||
@@ -44,5 +56,6 @@ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.state = { | ||
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.state = { | ||
stateValue: _this.initializeStateValue() | ||
}, _this.dispatch = function (action) { | ||
var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop; | ||
return _this.setState(function (_ref) { | ||
@@ -53,4 +66,6 @@ var stateValue = _ref.stateValue; | ||
}; | ||
}, function () { | ||
return callback(_this.state.stateValue); | ||
}); | ||
}, _temp), _possibleConstructorReturn(_this, _ret); | ||
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | ||
} | ||
@@ -68,3 +83,3 @@ | ||
return factory(_extends({}, this.props, (_extends2 = {}, _extends2[stateName] = this.state.stateValue, _extends2[dispatchName] = this.dispatch, _extends2))); | ||
return factory((0, _extends4.default)({}, this.props, (_extends2 = {}, _extends2[stateName] = this.state.stateValue, _extends2[dispatchName] = this.dispatch, _extends2))); | ||
}; | ||
@@ -71,0 +86,0 @@ |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
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; }; | ||
var _extends3 = require('babel-runtime/helpers/extends'); | ||
var _extends4 = _interopRequireDefault(_extends3); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _react = require('react'); | ||
@@ -19,8 +35,2 @@ | ||
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 withState = function withState(stateName, stateUpdaterName, initialState) { | ||
@@ -31,3 +41,3 @@ return function (BaseComponent) { | ||
var WithState = function (_Component) { | ||
_inherits(WithState, _Component); | ||
(0, _inherits3.default)(WithState, _Component); | ||
@@ -37,3 +47,3 @@ function WithState() { | ||
_classCallCheck(this, WithState); | ||
(0, _classCallCheck3.default)(this, WithState); | ||
@@ -44,3 +54,3 @@ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.state = { | ||
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.state = { | ||
stateValue: typeof initialState === 'function' ? initialState(_this.props) : initialState | ||
@@ -54,3 +64,3 @@ }, _this.updateStateValue = function (updateFn, callback) { | ||
}, callback); | ||
}, _temp), _possibleConstructorReturn(_this, _ret); | ||
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | ||
} | ||
@@ -61,3 +71,3 @@ | ||
return factory(_extends({}, this.props, (_extends2 = {}, _extends2[stateName] = this.state.stateValue, _extends2[stateUpdaterName] = this.updateStateValue, _extends2))); | ||
return factory((0, _extends4.default)({}, this.props, (_extends2 = {}, _extends2[stateName] = this.state.stateValue, _extends2[stateUpdaterName] = this.updateStateValue, _extends2))); | ||
}; | ||
@@ -64,0 +74,0 @@ |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
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; }; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _react = require('react'); | ||
@@ -27,8 +43,2 @@ | ||
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 withStateHandlers = function withStateHandlers(initialState, stateUpdaters) { | ||
@@ -39,3 +49,3 @@ return function (BaseComponent) { | ||
var WithStateHandlers = function (_Component) { | ||
_inherits(WithStateHandlers, _Component); | ||
(0, _inherits3.default)(WithStateHandlers, _Component); | ||
@@ -45,3 +55,3 @@ function WithStateHandlers() { | ||
_classCallCheck(this, WithStateHandlers); | ||
(0, _classCallCheck3.default)(this, WithStateHandlers); | ||
@@ -52,3 +62,3 @@ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _initialiseProps.call(_this), _temp), _possibleConstructorReturn(_this, _ret); | ||
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, _Component.call.apply(_Component, [this].concat(args))), _this), _initialiseProps.call(_this), _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | ||
} | ||
@@ -65,3 +75,3 @@ | ||
WithStateHandlers.prototype.render = function render() { | ||
return factory(_extends({}, this.props, this.state, this.stateUpdaters)); | ||
return factory((0, _extends3.default)({}, this.props, this.state, this.stateUpdaters)); | ||
}; | ||
@@ -68,0 +78,0 @@ |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
@@ -5,0 +7,0 @@ var _getDisplayName = require('./getDisplayName'); |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
@@ -5,0 +7,0 @@ var _symbolObservable = require('symbol-observable'); |
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
261900
5552
7
3
+ Addedbabel-runtime@^6.26.0
+ Addedbabel-runtime@6.26.0(transitive)
+ Addedcore-js@2.6.12(transitive)
+ Addedreact-lifecycles-compat@3.0.4(transitive)
+ Addedregenerator-runtime@0.11.1(transitive)