Is there a clean way for a mobx when() call to fire after a timeout even if the predicate hasn't been true?
I could set an observable after a setTimeout and check that in the predicate, but then I'd have more to clean up. when has an options parameter but I haven't found the documentation for it.
Use whenWithTimeout from mobx-utils package
If you are using MobX 4.0.0 or higher you can just pass timeout directly to when as its option (3rd parameter). It has been mentioned in the changelog
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With