27 lines
576 B
TypeScript
27 lines
576 B
TypeScript
const process = () => {
|
|
window.wpj.jsShop.events = (() => {
|
|
const eventsStorage = (window.wpj.jsShop.events ?? []) as unknown as (() => void)[];
|
|
|
|
return {
|
|
push(callback: () => void) {
|
|
callback();
|
|
},
|
|
unshift(callback: () => void) {
|
|
callback();
|
|
},
|
|
getAll() {
|
|
return eventsStorage;
|
|
}
|
|
};
|
|
})();
|
|
|
|
const events: any = window.wpj.jsShop.events.getAll();
|
|
for (let i = 0; i < events.length; i++) {
|
|
events[i]();
|
|
}
|
|
}
|
|
|
|
export const InitEvents = {
|
|
process
|
|
}
|