onReady
The onReady
function in the xAtom framework is a useful utility that ensures your code is executed only when all web page resources have been fully loaded.
Getting Started​
To begin using the onReady
function, follow these steps:
Pro Tip​
Use
onReady
as the entry point of your xAtom project. Place theonReady
function in your project's entry file.
Example
import { onReady } from "@xatom/core";
onReady(() => {
// Add your business logic here
});
Syntax​
onReady(cb: () => void): void
Parameter​
Name | Type | Description |
---|---|---|
cb | function | A callback function |