Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102553146
compose.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Feb 21, 22:45
Size
1006 B
Mime Type
text/x-java
Expires
Sun, Feb 23, 22:45 (2 d)
Engine
blob
Format
Raw Data
Handle
24359291
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
compose.js
View Options
import _extends from "@babel/runtime/helpers/esm/extends";
import merge from './merge';
function compose() {
for (var _len = arguments.length, styles = new Array(_len), _key = 0; _key < _len; _key++) {
styles[_key] = arguments[_key];
}
var handlers = styles.reduce(function (acc, style) {
style.filterProps.forEach(function (prop) {
acc[prop] = style;
});
return acc;
}, {});
// false positive
// eslint-disable-next-line react/function-component-definition
var fn = function fn(props) {
return Object.keys(props).reduce(function (acc, prop) {
if (handlers[prop]) {
return merge(acc, handlers[prop](props));
}
return acc;
}, {});
};
fn.propTypes = process.env.NODE_ENV !== 'production' ? styles.reduce(function (acc, style) {
return _extends(acc, style.propTypes);
}, {}) : {};
fn.filterProps = styles.reduce(function (acc, style) {
return acc.concat(style.filterProps);
}, []);
return fn;
}
export default compose;
Event Timeline
Log In to Comment