UNPKG

@benev/slate

Version:
20 lines 483 B
import { Signal } from "../signals/signal.js"; export function maybe(x, fn) { const y = x instanceof Signal ? x.value : x; return y ? fn(y) : undefined; } export function whereby(x, fn) { const y = x instanceof Signal ? x.value : x; return (y === undefined || y === null) ? undefined : fn(y); } /** @deprecated renamed to `whereby` */ export const wherefor = whereby; //# sourceMappingURL=helpers.js.map