How to use the pro-gallery/dist/src/utils/constants/events.APP_LOADED function in pro-gallery

To help you get started, we’ve selected a few pro-gallery examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wix / pro-gallery / packages / playground / src / components / App / App.js View on Github external
const eventListener = (eventName, eventData) => {
    switch (eventName) {
      case GALLERY_EVENTS.APP_LOADED: 
      case GALLERY_EVENTS.GALLERY_CHANGE: 
        setGalleryReady();
        break;
      case GALLERY_EVENTS.NEED_MORE_ITEMS: 
        setItems(getItems().concat(mixAndSlice(testItems, ITEMS_BATCH_SIZE)));
        break;
      case GALLERY_EVENTS.ITEM_ACTION_TRIGGERED: 
        setFullscreenIdx(eventData.idx);
        break;
      default: 
        // console.log({eventName, eventData});
        break;
    }
  }