Discovered whilst using the component that the docs implicitly suggest the returned gallery is an Array, whereas it is an Object.
This causes errors:
Runtime error as cannot iterate over the returned Object
Cannot access [gallery] or gallery[0] as both are undefined
Example code updated to show correct usage (per my implimentation)
Also noted that adding the trigger method ought to be protected by a check to see if a gallery exists, otherwise we have a breaking runtime error - can't add a lister to a null object.
Added defensive conditional to example code.
Discovered whilst using the component that the docs implicitly suggest the returned gallery is an Array, whereas it is an Object. This causes errors:
Also noted that adding the trigger method ought to be protected by a check to see if a gallery exists, otherwise we have a breaking runtime error - can't add a lister to a null object. Added defensive conditional to example code.