Browser API
Search…
Browser API (1.0.4)
Getting Started
Examples
API Reference
API Events
Release history
Why PickyStory
License
Powered By
GitBook
API Events
PickyStoryEvent
Public event sent to listeners in customer code.
Kind
: global class
PickyStoryEvent
new PickyStoryEvent(name, [payload])
instance
.validate
⇒
boolean
.extractPayload
⇒
Object
static
.type
.Events
new PickyStoryEvent(name, [payload])
Event constructor, requires event name and an optional payload object
Param
Type
Description
name
string
one of the values in {Events}
[payload]
Object
optional payload object
pickyStoryEvent.validate ⇒
boolean
Validate event and optionally filter the desired event type
Kind
: instance property of
PickyStoryEvent
Returns
:
boolean
- true if valid, false otherwise
Param
Type
Description
event
PickyStoryEvent
the input event object
[name]
string
optional event name to filter
pickyStoryEvent.extractPayload ⇒
Object
Helper method to accept only the desired event type and extract its payload
Kind
: instance property of
PickyStoryEvent
Returns
:
Object
- payload object or null if the event does not match the desired name
Param
Type
Description
event
PickyStoryEvent
the input event object
[name]
string
optional event name to filter
PickyStoryEvent.type
Public event type used as the
typeArg
value of CustomEvent
Kind
: static property of
PickyStoryEvent
PickyStoryEvent.Events
Supported API event names
Kind
: static property of
PickyStoryEvent
API_READY
Browser API has finished loading and is ready for use
Kind
: global variable
DEAL_DISCOUNTS
Deal discounts have been applied to the current cart
Kind
: global variable
Browser API (1.0.4) - Previous
API Reference
Next - Browser API (1.0.4)
Release history
Last modified
13d ago
Copy link
Contents
PickyStoryEvent
API_READY
DEAL_DISCOUNTS