Skip to content

Instance Method

nonemptyFlatMap(_:)

Checks that the future’s value (if any) returns false for .isEmpty. If the check fails, a new future with an empty array as its value is returned. Otherwise, the provided normal flatMap() callback is invoked. The callback’s returned future must have a value type that is an Array or a RangeReplaceableCollection.
func nonemptyFlatMap<NewValue>(_ transform: @escaping (Value) -> EventLoopFuture<NewValue>) -> EventLoopFuture<NewValue> where Value : Collection, NewValue : RangeReplaceableCollection

See Also

EventLoopFuture