static async fetchCoinHistory(time, coin, currency, past) { return flow( get('data.Data'), map('close') )(await axios.get( CryptoCompareAPI.History(time, coin, currency, past))) }
export default function getMajorLanguage(languages) { const sumLinesOfCode = reduce((sum, linesOfCode) => sum + linesOfCode, 0)( languages, ) const highUsageLanguages = flow( pickBy((value, key) => (value > 10000 ? key : null)), keys, )(languages) const mostPopularLanguage = flow( mapValues((value, key) => value / sumLinesOfCode), obj => [keys(obj).reduce((a, b) => (obj[a] > obj[b] ? a : b), null)], filter(value => value), )(languages) return union([...highUsageLanguages, ...mostPopularLanguage]) }
const time = () => flow(remove(negate(first)), first)([ [args.mins ,'minutes' ,'histominute'], [args.hours ,'hours' ,'histohour'], [args.days ,'days' ,'histoday'] ])
connect(mapStateToProps, { moveWidget, saveMovedWidget, deleteWidget, openSnackbar })( flow( DragSource( WidgetTypes.MOVE, widgetSource, (connect, monitor) => ({ connectDragSource: connect.dragSource(), }), ), DropTarget(WidgetTypes.MOVE, widgetTarget, (connect) => ({ connectDropTarget: connect.dropTarget(), })) )( withStyles(styles)(SortableWidget) ) )
const printCoins = async () => flow(map(trim), sortBy(toLower), map(print))( await CryptoCompareAPI.fetchCoinList())
const getOptions = table => flow(getTable(table), get('options'))
flow( getContentType, type => type && ~type.indexOf('json'), )
const getInitial = table => flow(getTable(table), getOr({}, 'initial'))
static async fetchCoinList() { return flow( get('data.Data'), map('FullName') )(await axios.get(CryptoCompareAPI.CoinList())) }
function uniqueOrDistinct(feature) { return x => flow(map(feature), uniq, size)(x) !== 2; }
const getTable = table => flow(datatableSelector, get(table))
const getData = table => flow(getTable(table), get('data'))
flow( getContentType, type => type && ~type.indexOf('x-www-form-urlencoded'), )
const isFetching = table => flow(getTable(table), getOr(false, 'fetching'))
const isError = table => flow(getTable(table), getOr(false, 'error'))