RenderLifecycle

Unpublished development API. This package is under development and is not available as a published release.

Measurements gathered from RenderSpec events. Pass onEvent to one or more trees, and read the snapshot with useSyncExternalStore(lifecycle.subscribe, lifecycle.getSnapshot).

import type { RenderLifecycle } from '@threadplane/react/render';

Declaration

export interface RenderLifecycle  {
  readonly getSnapshot: () => RenderLifecycleSnapshot;
  readonly onEvent: (event: RenderEvent) => void;
  readonly subscribe: (listener: () => void) => () => void;
}

Members

getSnapshot

readonly getSnapshot: () => RenderLifecycleSnapshot;

onEvent

readonly onEvent: (event: RenderEvent) => void;

subscribe

readonly subscribe: (listener: () => void) => () => void;