@tempots/dom
Version:
Fully-typed frontend framework alternative to React and Angular
17 lines (16 loc) • 761 B
TypeScript
import { Signal } from '../std/signal';
import { Value } from '../std/value';
import { Renderable } from '../types/domain';
/**
* Returns a renderable component that displays the given `display` component
* when the `signal` contains a non-empty array, and the `whenEmpty` component
* otherwise.
*
* @typeParam T - The type of elements in the array.
* @param value - The signal or literal containing the array.
* @param display - The component to display when the array is non-empty.
* @param whenEmpty- The component to display when the array is empty.
* @returns - The renderable component.
* @public
*/
export declare const NotEmpty: <T>(value: Value<T[]>, display: (value: Signal<T[]>) => Renderable, whenEmpty?: () => Renderable) => Renderable;