Wait until `fn` returns `true`.

W A R N I N G
This method was designed mainly for prototyping (where code cleanliness is important).
It might drastically decrease performance.
