GraphReFlyTS

API Reference

emitLayoutError()

Emit a layout error through the graph protocol.

Import

import { emitLayoutError } from "@graphrefly/ts/solutions/reactive-layout";

Signature

function emitLayoutError(
	ctx: Ctx,
	error: unknown,
	fallback: string,
): void

Parameters

ParameterTypeDescription
ctxCtxCurrent fn context.
errorunknownError payload to normalize.
fallbackstringFallback message used for invalid payloads.

Returns

Nothing; the error is emitted via ctx.down.

Example

emitLayoutError(ctx, new Error("bad layout"), "layout failed");

Source

packages/ts/src/solutions/reactive-layout/utils.ts