Helpers are divided into two categories:
- DOM events utility helpers (mainly user interaction like resize and scroll)
- Custom easings for animation
- Cookies helper class (deprecated)
- User agents detection function to parse and detect browser and device (deprecated)
In main.js use es6 import to add helper module and use the reduce function to create a global object.
var arr = [
{ util: EVENT_UTILITIES },
];
global.Helpers = arr.reduce(function (result, item) {
var key = Object.keys(item);
result[key] = item[key];
return result;
}, {});
Retrieve the real global object in all possible environments Expose to window Export an instantiated class