ConrabOpto / mst-query

Query library for mobx-state-tree
MIT License
110 stars 7 forks source link

fix: stale time with huge value #25

Closed benjaminkwokhuen closed 2 years ago

benjaminkwokhuen commented 2 years ago

In Javascript, setTimeout has a limit. If the ms exceeds that, the setTimeout callback will be executed after 1 ms.

This is not an expected behavior. For example, I would like to pass in Infinity to have that value stale for a very long time. Currently, passing Infinity will have no effect.

ref: https://stackoverflow.com/questions/3468607/why-does-settimeout-break-for-large-millisecond-delay-values

Fixed #26

k-ode commented 2 years ago

TIL. Thanks! Released as 1.0.9