I’m trying to bring in some web libs, but the setTimeout function doesn’t exist in LS for some reason. I wrote this polyfill, but I’m not sure if it’s kosher. Do I need to clean up the event that I created? Seems like it could eat up memory over time if it’s not disposed.
function setTimeout(f, d){
var e = script.createEvent('DelayedCallbackEvent')
e.bind(function(){
f()
// TODO unbind??
e.enabled = false
})
e.reset(d)
}