export default function useDeepCompareMemoize(value) { const ref = useRef([]); if (!equals(value, ref.current)) { ref.current = value; } return ref.current; }
idIntersection.filter( id => !R.equals(idToNewStories[id], idToOldStories[id]) ).map(id => ({ ...idToNewStories[id], ...( ['rank', 'score', 'commentsCount', 'karma'].map(p => intDiff(p, idToOldStories[id], idToNewStories[id]))) .reduce((a, b) => ({ ...a, ...b })), prevSnapshotTimestamp: idToOldStories[id].snapshotTimestamp }))
shouldComponentUpdate(nextProps, nextState) { const { query, queries, render, cubejsApi, loadSql, updateOnlyOnStateChange } = this.props; if (!updateOnlyOnStateChange) { return true; } return !equals(nextProps.query, query) || !equals(nextProps.queries, queries) || ((nextProps.render == null || render == null) && nextProps.render !== render) || nextProps.cubejsApi !== cubejsApi || nextProps.loadSql !== loadSql || !equals(nextState, this.state) || nextProps.updateOnlyOnStateChange !== updateOnlyOnStateChange; }
pivotConfig.fillMissingDates && pivotConfig.x.length === 1 && (equals( pivotConfig.x, (query.timeDimensions || [])
const regularMeasuresCubes = cubeNames(regularMeasures); const multipliedMeasuresCubes = cubeNames(multipliedMeasures); if (R.equals(regularMeasuresCubes, multipliedMeasuresCubes)) { toJoin = R.pipe( R.groupBy(m => m.cube().name),
let isInputTransactionsUnspent = R.all(R.equals(false), R.flatten(R.map((txInput) => { return R.map( R.pipe(
}, transaction.data.inputs); if (R.all(R.equals(false), transactionInputFoundAnywhere)) { if (transaction.type === 'regular' && negativeOutputsFound === 0) { selectedTransactions.push(transaction);
let reducer = (state = initialState, action) => R.cond([ [R.equals('INCREMENT'), () => ({...state, number: state.number + 1})], [R.equals('DECREMENT'), () => ({...state, number: state.number - 1})], [R.equals('DOUBLE'), () => ({...state, number: state.number * 2})], [R.equals('RANDOM'), () => ({...state, number: Math.floor(Math.random()*100)})], [R.equals('RESET'), () => ({...state, number: 0})], [R.T, R.always(state)] ])(action.type)
const parseUrl = (url) => { if (URL_CONFIG) { const urlMatch = find((config) => equals( '/' + prop('url', config), url ), URL_CONFIG); if (!urlMatch) throw new Error('Invalid resquest url'); return urlMatch.path; } else { return `url${url}`; } }
export default function useDeepCompareMemoize(value) { const ref = useRef([]); if (!equals(value, ref.current)) { ref.current = value; } return ref.current; }