plandalf.ready()
Run a callback when the SDK instance is ready.
Implemented by the browser object.
Signature
plandalf.ready(cb: (instance: Plandalf) => void): voidArguments
| Name | Type | Meaning |
|---|---|---|
cb | (instance: Plandalf) => void | Callback invoked with the initialized class instance. |
Example
ready.js
plandalf.ready(() => {
console.log(plandalf.getAnonId())
})Returns
void
Behaviour
Use this callback before calling methods that depend on initialization. It receives the raw Plandalf class instance, but ordinary browser code can keep using plandalf.