The `error` and `warn` functions are missing in the `frontity` API docs
luisherranz opened this issue · comments
The frontity
package exports an error
and warn
helpers to be used by package developers when they need to either throw an error or log a warn in the console.
None of them are yet documented in the frontity
API section of our docs: https://docs.frontity.org/api-reference-1/frontity
I've added proper TSDocs for those functions in this PR: frontity/frontity#515
Please take into account that the code is in the @frontity/error
package of our monorepo, but they should be imported using frontity
by the packages, so they belong to the frontity
API.
import { error, warn } from "frontity";
Examples of usage:
- https://github.com/frontity/frontity/blob/dev/packages/wp-source/src/actions.ts#L120
- https://github.com/frontity/frontity/blob/dev/packages/components/link.tsx#L82
- https://github.com/frontity/frontity/blob/dev/packages/components/switch.tsx#L29
- https://github.com/frontity/frontity/blob/dev/packages/frontity/src/utils/slot-and-fill/use-fills.tsx#L54