The predicate that should be evaluated.
Optional
options: { Optional options.
The number of milliseconds to wait before timing out.
A promise that resolves when the predicate evaluates to true.
const a = atom(0, { name: "a" });
let foo = 0;
waitTrue(() => a.value > 3).then(() => {
foo++;
});
a.value = 2; // foo = 0
a.value = 3; // foo = 0
a.value = 4; // foo = 1
Waits until the given predicate evaluates to true.