This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Based on jQuery $.on API | |
* Helpful when trying to bind to an element that might get re-renderd in future | |
* because of some AJAX call or some other DOM manipulation | |
* that required detaching the element or it's parent from the DOM. | |
* Saves the extra code to re-attach all the event handlers. | |
*/ | |
const delegateEvent = (el, evt, sel, handler, useCapture) => { | |
if(typeof useCapture === 'undefined') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const asyncForEach = async (array, cb) => { | |
for (let index = 0; index < array.length; index++) { | |
await cb(array[index], index, array); | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
files=( | |
ccPaymentTotal | |
getPaymentByMethodType | |
getTotalPaidByMethodType | |
getPointsBalance | |
getLineItemCountByState | |
getAggregateDiscountTypeForOrder | |
getAggregateDiscountTotalForOrder |