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
| Parameter | Type | Description |
|---|---|---|
ctx | Ctx | Current fn context. |
error | unknown | Error payload to normalize. |
fallback | string | Fallback 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