```js
fn zalgo(ms, cb) {
if (ms === 0) cb();
else setTimeout(cb, ms);
}
```
Adding more ways to introduce this footgun seems bad but should we not also trust developers with perf features?
```js
fn zalgo(ms, cb) {
if (ms === 0) cb();
else setTimeout(cb, ms);
}
```
Adding more ways to introduce this footgun seems bad but should we not also trust developers with perf features?
const [data, setData] = useState(() => fetchData());
return (
<>
<div>{use(data)}</div>
<button onClick={() => setData(fetchOtherData())}>Click</button>
</>
);
}
This pattern is pretty nice to get a stable promise that can be updated at whenever.
const [data, setData] = useState(() => fetchData());
return (
<>
<div>{use(data)}</div>
<button onClick={() => setData(fetchOtherData())}>Click</button>
</>
);
}
This pattern is pretty nice to get a stable promise that can be updated at whenever.
This will reject with 2
This will reject with 2