i'm running the basic-setup example, getting an error when trying to setTimeout.
why is that?
Hey @talarari!
Sketch's JS environment doesn't provide setTimeout. We should polyfill it in skpm (like we did with console & fetch), but until then, this snippet in your main function should work.
export default (context) => {
// setInterval - note that time is in seconds, not milliseconds
coscript.shouldKeepAround = true;
coscript.scheduleWithInterval_jsFunction(1.0, (cinterval) => {
log('after 1 second!');
coscript.shouldKeepAround = false;
});
}
Added in [email protected] 馃槃
Most helpful comment
Added in [email protected] 馃槃