@benev/slate
Version:
frontend web stuff
20 lines • 483 B
JavaScript
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