Tag: loader

Javascript loader with promises

A few days ago, while refactoring this website, I came across an interesting technique to load JS scripts using promises. My objective was to load the home page game scripts only on desktop devices (to minimise the loading impact on mobiles). The device detection part can be done like this:…