Skip to content

Instance Method

nonemptyMap(_:)

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 map() callback is invoked. The callback’s return type must be an Array or a RangeReplaceableCollection.
func nonemptyMap<NewValue>(_ transform: @escaping (Value) -> NewValue) -> EventLoopFuture<NewValue> where Value : Collection, NewValue : RangeReplaceableCollection

See Also

EventLoopFuture