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 future: EventLoopFuture<T>) -> EventLoopFuture<T>

Discussion

let user = User.find(id, on: request)
posts.save(on: request).transform(to: user)