# Disable Atomics object (`ts-compat/no-atomics`) 💼 This rule is enabled in the ✅ `recommended` config. `Atomics` has never been supported by any version of IE. MDN reports the namespace from Chrome 68, Edge 79, Firefox 78, Safari 15.2 and Opera 55, because the methods are only useful on a `SharedArrayBuffer`, which itself needs a cross-origin isolated context and is missing in Safari before 15.2. `Atomics` can not be polyfilled: reading and writing one value atomically depends on the engine and on shared memory, and a fake implementation would silently lose the guarantee it is there for. Web pages are single threaded, so ordinary typed array reads and writes are enough until the code really runs in a worker with shared memory. ## Rule Details Examples of **incorrect** code for this rule: ```ts const view = new Int32Array(new SharedArrayBuffer(8)); Atomics.store(view, 0, 10); Atomics.load(view, 0); Atomics.add(view, 0, 5); Atomics.wait(view, 0, 10); Atomics.isLockFree(4); ``` Examples of **correct** code for this rule: ```ts const view = new Int32Array(8); view[0] = 10; const value = view[0]; ``` ## When Not To Use It * Every target browser supports `SharedArrayBuffer`, the page is cross-origin isolated and the code really shares memory between workers. ## Further Reading * [MDN Atomics](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics) * [can i use SharedArrayBuffer](https://caniuse.com/sharedarraybuffer)