Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drylikov/tiny_set_immediate
Modern polyfill for set immediate.
https://github.com/drylikov/tiny_set_immediate
Last synced: 8 days ago
JSON representation
Modern polyfill for set immediate.
- Host: GitHub
- URL: https://github.com/drylikov/tiny_set_immediate
- Owner: drylikov
- License: mit
- Created: 2024-06-23T22:32:26.000Z (5 months ago)
- Default Branch: drylikov
- Last Pushed: 2024-09-07T01:07:03.000Z (2 months ago)
- Last Synced: 2024-09-07T03:40:58.518Z (2 months ago)
- Language: TypeScript
- Size: 163 KB
- Stars: 3
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Tiny_set_immediate
A minimal polyfill of setImmediate, for modern browsers using `window.postMessage`, and `MessageChannel` in workers.
If the native functions are available they will be returned instead of a polyfill.
```ts
import { setImmediate, clearImmediate } from 'Tiny_set_immediate';const handle = setImmediate(
(...args) => {
console.log(args);
},
[1, 2],
);clearImmediate(handle);
```This implementation does not allow string callbacks, and will not eval it.