sindresorhus/p-wait-for

Ignore errors

Closed this issue · 2 comments

Like falsy return values, errors could also be ignored.

await pWaitFor(() => {
	assert(system.time > '10:30')
}, {ignoreErrors: error => error instanceOf AssertionError})

Yeah, I guess. It's only a tiny improvement over doing try/catch though.

How about calling it filterError?

It's only a tiny improvement over doing try/catch though.

You're not wrong