Skip to content

Instance Method

nonemptyFlatMap(orFlat:_:)

Checks that the future’s value (if any) returns false for .isEmpty. If the check fails, the provided alternate future is returned. Otherwise, the provided normal flatMap() callback is invoked.
func nonemptyFlatMap<NewValue>(orFlat alternate: @autoclosure @escaping () -> EventLoopFuture<NewValue>, _ transform: @escaping (Value) -> EventLoopFuture<NewValue>) -> EventLoopFuture<NewValue> where Value : Collection

See Also

EventLoopFuture