Truthy
T without its falsy members (null, undefined, false, 0, 0n, ''): what a Show or Match branch callback receives.
Usage
Type content rendered for a present value.
// Type content rendered for a present value.
import { Show, Text, signal, type Truthy } from 'kuito';
type User = { name: string } | null;
const user = signal<User>(null);
// The branch callback gets the user without `null`: no check needed inside.
const greet = (signedIn: Truthy<User>) => <Text>Hello, {signedIn.name}</Text>;
<Show when={user.value} fallback={<Text>Sign in</Text>}>
{greet}
</Show>;Type declaration
export type Truthy<T> = Exclude<T, null | undefined | false | 0 | 0n | ''>;Type
T extends false | "" | 0 | 0n ? never : TGenerated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.