isFailure (@shadow-js/dusk/server)
True for a value fail made (or one that has its shape, after the wire). (isFailure of @shadow-js/dusk/server)
True for a value fail made (or one that has its shape, after the wire).
Import#
ts
import { isFailure } from "@shadow-js/dusk/server";
Signature#
ts
function isFailure(value: unknown): value is ActionFailure
Parameters#
| Name | Description |
|---|---|
value |
Anything a server function returned. |
Returns#
true for a failure.
Examples#
ts
if (isFailure(result)) showProblems(result.data);