mcollina / async-cache-dedupe

Async cache with dedupe support
MIT License
640 stars 40 forks source link

Call setTimeout instead of setImmediate when running in the browser #56

Closed dimfeld closed 1 year ago

dimfeld commented 1 year ago

setImmediate isn't implemented in any modern browser, so this updates the memory storage engine to call setTimeout instead when running in the browser. Behavior under Node is unchanged.

Note that this uses globalThis, which is only supported in Node 12+.

Resolves #55