Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return function(...args) {
// Calculate the new state.
const currentProps = merge(this.state, omitDefaults(this.props), this.boundActionCreators);
const newState = reducer(currentProps, ...args);
// Update the state.
this.setState(newState);
// If there are callbacks for the changed values, invoke them.
keys(newState).forEach(prop => {
const newValue = newState[prop];
const callbackName = toCallbackName(prop);
const cb = this.props[callbackName];
if (cb) cb(newValue);
});
};
});
const ownEnumerableKeys = (object) => {
if (typeof Reflect === 'object' && typeof Reflect.ownKeys === 'function') {
return Reflect.ownKeys(object)
.filter(key => Object.getOwnPropertyDescriptor(object, key).enumerable)
}
if (typeof Object.getOwnPropertySymbols === 'function') {
return Object.getOwnPropertySymbols(object)
.filter(key => Object.getOwnPropertyDescriptor(object, key).enumerable)
.concat(objectKeys(object))
}
return objectKeys(object)
}
function stringifyParams (obj) {
return obj ? arrayMap(objectKeys(obj).sort(), function (key) {
var val = obj[key]
if (angular.isArray(val)) {
return arrayMap(val.sort(), function (val2) {
return encodeURIComponent(key) + '=' + encodeURIComponent(val2)
}).join('&')
}
return encodeURIComponent(key) + '=' + encodeURIComponent(val)
}).join('&') : ''
}
const ownEnumerableKeys = (object) => {
if (typeof Reflect === 'object' && typeof Reflect.ownKeys === 'function') {
return Reflect.ownKeys(object)
.filter(key => Object.getOwnPropertyDescriptor(object, key).enumerable)
}
if (typeof Object.getOwnPropertySymbols === 'function') {
return Object.getOwnPropertySymbols(object)
.filter(key => Object.getOwnPropertyDescriptor(object, key).enumerable)
.concat(objectKeys(object))
}
return objectKeys(object)
}