Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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;
}
}