My work has me working on a React App and the code has an onload event listener
The load event listener is supposed to fire a function to create cookies on load but instead never fires
For example:
window.addEventListener('load', function(){
console.log('Yo 2');
});
window.addEventListener('load', console.log('Yo'))
Yo prints before Yo 2
What the timing difference and why?
This is a simplified form of the Bug, we thought it was a cookie issue but the cookie is never created so we had to back track and realize the event listener isn't firing correctly on some machines.
Our actual call back function is async, could this be why?