Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #93 from nodes-vapor/feature/prepare-for-rc
Browse files Browse the repository at this point in the history
Feature/prepare for rc
  • Loading branch information
siemensikkema authored Mar 6, 2019
2 parents 932527b + d681bb4 commit e024c2d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 0 additions & 6 deletions Sources/Sugar/Helpers/Future.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ public extension Future {
try callback(expectation).map { _ in expectation }
}
}

public func flatTry(_ callback: @escaping (Expectation) throws -> Future<Any>) -> Future<T> {
return flatMap { expectation in
try callback(expectation).map { _ in expectation }
}
}
}

public extension Future where Expectation: OptionalType {
Expand Down
8 changes: 8 additions & 0 deletions Sources/Sugar/Helpers/Updatable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,11 @@ extension Updatable where Update: Decodable {
.transform(to: self)
}
}

extension Future where T: Updatable, T.Update: Decodable {
public func applyUpdate(on req: Request) -> Future<T> {
return flatMap {
$0.applyUpdate(on: req)
}
}
}

0 comments on commit e024c2d

Please sign in to comment.