@react-hookz/web
Version:
React hooks done right, for browser and SSR.
12 lines (11 loc) • 592 B
JavaScript
export const noop = () => { };
export const isBrowser = typeof globalThis !== 'undefined' &&
typeof navigator !== 'undefined' &&
typeof document !== 'undefined';
/**
* You should only be reaching for this function when you're attempting to prevent multiple
* redefinitions of the same function. In-place strict equality checks are more performant.
*/
export const isStrictEqual = (previous, next) => previous === next;
export const truthyAndArrayPredicate = (conditions) => conditions.every(Boolean);
export const truthyOrArrayPredicate = (conditions) => conditions.some(Boolean);