signal
A signal. Made while a component sets up, it belongs to that component's slot: it keeps its value across Live Patches and goes when the component unmounts. Made anywhere else, it is a signal of its own, which every component that reads it shares.
Utilização
Announce changing status
import { Text, signal } from 'kuito';
export function Status() {
const status = signal('Uploading…');
return <Text live="polite">{status.value}</Text>;
}Assinaturas
<T>(initial: T, name?: string): Signal<T>Parâmetros de tipo
| Nome | Restrição | Predefinição |
|---|---|---|
T | — | — |
Parâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
initial | T | Sim | — |
name | string | Não | — |
Devolve
Signal<T>
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.