@socketsupply/socket
Version:
A Cross-Platform, Native Runtime for Desktop and Mobile Apps — Create apps using HTML, CSS, and JavaScript. Written from the ground up to be small and maintainable.
15 lines (13 loc) • 522 B
JavaScript
export const platform = {
setTimeout: globalThis.setTimeout.bind(globalThis),
setInterval: globalThis.setInterval.bind(globalThis),
setImmediate: globalThis.setTimeout.bind(globalThis),
clearTimeout: globalThis.clearTimeout.bind(globalThis),
clearInterval: globalThis.clearInterval.bind(globalThis),
clearImmediate: globalThis.clearTimeout.bind(globalThis),
postTask: (
globalThis.scheduler?.postTask?.bind?.(globalThis?.scheduler) ??
async function notSupported () {}
)
}
export default platform