Open gkiely opened 4 years ago
Description: A once event allows firing a listener one time and automatically removes that listener.
Use case An event handler for a modal background.
Before:
Gator(document).on('click', '.modal-bg', () => { modal.setVisible(false); Gator(document).off('click', '.modal-bg'); });
After:
Gator(document).once('click', '.modal-bg', () => { modal.setVisible(false) });
Description: A once event allows firing a listener one time and automatically removes that listener.
Use case An event handler for a modal background.
Before:
After: