@functional-lib/pagination
Version:
This is the pagination functional library
12 lines (11 loc) • 551 B
JavaScript
import { Left, Right } from "sanctuary";
export const compose = (...fns) => x => fns.reduceRight((v, f) => f(v), x);
export const add = valueA => valueB => valueA + valueB;
export const less = a => b => a - b;
export const not = value => !value;
export const toArray = x =>[x];
export const is = cond => cond.every(Boolean);
export const prop = prop => obj => obj[prop];
export const substract = valueA => valueB => valueA - valueB;
export const lt = valueA => valueB => valueA < valueB;
export const getRighOrLeft = cond => cond ? Right : Left;