Utilização

Observe notifications received in the foreground.

tsx
// Observe notifications received in the foreground.
import { Text, notifications, signal } from 'kuito';

function Inbox() {
  const latest = signal('');

  // Stops when Inbox unmounts.
  notifications.watch('received', (notification) => {
    if (notification.remote) latest.value = notification.title ?? '';
  });

  return <Text>{latest.value}</Text>;
}

Assinaturas

ts
<E extends keyof Events>(event: E, listener: Events[E]): EventSubscription

Parâmetros de tipo

NomeRestriçãoPredefinição
E"received"—

Parâmetros

NomeTipoObrigatórioDescrição
eventESim—
listenerEvents[E]Sim—

Devolve

EventSubscription

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.