findAsync

fun <T> findAsync(fn: (data: Any?, options: ArrayOptions?) -> Boolean, options: ArrayOptions = definedExternally): ERROR CLASS: Symbol not found for Promise<T?>(source)

This method is similar to Array.prototype.find and calls fn on each chunk in the stream to find a chunk with a truthy value for fn. Once an fn call's awaited return value is truthy, the stream is destroyed and the promise is fulfilled with value for which fn returned a truthy value. If all of the fn calls on the chunks return a falsy value, the promise is fulfilled with undefined.

Since

v17.5.0

Parameters

fn

a function to call on each chunk of the stream. Async or not.


fun findAsync(fn: (data: Any?, options: ArrayOptions?) -> ERROR CLASS: Symbol not found for js.promise.PromiseResult<kotlin/Boolean>, options: ArrayOptions = definedExternally): ERROR CLASS: Symbol not found for Promise<kotlin/Any?>(source)