warn
Reports a development-only diagnostic.
Reports a development-only diagnostic. Only the first warning of each code is reported, for the
whole program, until resetWarningDedupe; it goes to the listener of
setWarningListener, or to console.warn with the text of formatMessage. Does
nothing in production builds. Use it for a mistake that should not stop the app; throw
ShadowError for one that must.
Import#
ts
import { warn } from "@shadow-js/core/extend";
Signature#
ts
function warn(code: MessageCode): void
Parameters#
| Name | Description |
|---|---|
code |
The diagnostic code to report. |
Examples#
ts
import { currentOwner, warn } from "@shadow-js/core/extend";
export function useTicker(): void {
if (currentOwner() === null) warn("NO_OWNER_CLEANUP");
}