ramda#isNil JavaScript Examples

The following examples show how to use ramda#isNil. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: useGeneratedID.js    From lundium with MIT License 6 votes vote down vote up
useGeneratedID = () => {
	const uniqueID = useRef(null);

	if (isNil(uniqueID.current)) {
		uniqueID.current = getLastID();
	}

	return uniqueID.current;
}
Example #2
Source File: rendering.js    From web with GNU General Public License v3.0 5 votes vote down vote up
renderWhenNotNil = fn => renderWhen(complement(isNil), fn)
Example #3
Source File: helpers.js    From sdk with MIT License 5 votes vote down vote up
assertNotNil = when(isNil, () => {
  throw new Error("Value can't be `null` or `undefined`");
})
Example #4
Source File: Tab.js    From lundium with MIT License 5 votes vote down vote up
Tab = ({
	className,
	label,
	isActive,
	isDone,
	isDisabled,
	isInvalid,
	stepNumber,
	href,
	...otherProps
}) => {
	const WrapperComponent = isDisabled || isNil(href) ? 'span' : Link;

	return (
		<WrapperComponent
			className={cx(
				'tab-link',
				{
					['tab-link--active']: isActive,
					['tab-link--done']: isDone,
					['tab-link--disabled']: isDisabled,
					['tab-link--invalid']: isInvalid,
					['tab-link--wizard']: !isNil(stepNumber),
				},
				className,
			)}
			{...(isDisabled ? {} : { href })}
			{...otherProps}
		>
			{!isNil(stepNumber) && (
				<span className="tab-link__number">{stepNumber}</span>
			)}
			{label && (
				<Box as="span" className="tab-link__label">
					{label}
				</Box>
			)}
		</WrapperComponent>
	);
}
Example #5
Source File: isNotFilled.js    From lundium with MIT License 5 votes vote down vote up
isNotFilled = anyPass([
	either(isNil, equalsEmptyString),
	both(isArray, isEmpty),
])