Skip to content

Instance Method

transform(to:)

Maps the current future to contain the new type. Errors are carried over, successful (expected) results are transformed into the given instance.
func transform<T>(to instance: @autoclosure @escaping () -> T) -> EventLoopFuture<T>

Discussion

user.save(on: req).transform(to: HTTPStatus.created)

See Also

EventLoopFuture