plandalf.promo()
Open a live promo handle.
Implemented by the browser object; parameter and return types follow the delegated class declaration.
Call this after plandalf.ready(). The browser wrapper can return undefined before initialization.
Signature
plandalf.promo(slug: string): PromoHandleArguments
| Name | Type | Meaning |
|---|---|---|
slug | string | Promo slug to monitor. |
Example
promo.js
plandalf.ready(async () => {
const handle = plandalf.promo('early-bird')
const state = await handle
console.log(state?.remaining)
})Returns
Behaviour
The browser object forwards only the slug. The ES module class accepts additional PromoHandleOptions, which are not forwarded here.