Skip to main content

on

To attach a callback for different states of the window.Predis object.

Usage

predis.on("ready", () => {
// SDK is ready to call other methods e.g createPost
});

predis.on("error", () => {
// catch if there is any error SDK initialization
});

Parameters

NameDescriptionTypeRequired
stateThe state to attach a callback to.
Possible value: ready, error
Objectyes
callbackFunction to execute when the state is triggeredFunctionyes