Skip to content

Commit

Permalink
Merge branch 'release/2.0.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
malcommac committed Oct 8, 2020
2 parents a71d4c9 + f38480f commit f8c99b2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion HydraAsync.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'HydraAsync'
spec.version = '2.0.4 '
spec.version = '2.0.5'
spec.summary = 'Promises & Await: Write better async in Swift'
spec.homepage = 'https://github.com/malcommac/Hydra'
spec.license = { :type => 'MIT', :file => 'LICENSE' }
Expand Down
5 changes: 4 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// swift-tools-version:5.1
// swift-tools-version:5.3
import PackageDescription

let package = Package(
name: "Hydra",
platforms: [
.macOS(.v10_10), .iOS(.v8), .watchOS(.v2), .tvOS(.v9)
],
products: [
.library(name: "Hydra", targets: ["Hydra"])
],
Expand Down
4 changes: 2 additions & 2 deletions Sources/Hydra/Promise+Recover.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public extension Promise {
/// - Returns: a promise
func recover(in context: Context? = nil, _ body: @escaping (Error) throws -> Promise<Value>) -> Promise<Value> {
let ctx = context ?? .background
return Promise<Value>(in: ctx, token: self.invalidationToken, { [weak self] resolve, reject, operation in
self?.then(in: ctx, {
return Promise<Value>(in: ctx, token: self.invalidationToken, { resolve, reject, operation in
self.then(in: ctx, {
// If promise resolve we don't need to do anything.
resolve($0)
}).catch(in: ctx, { error in
Expand Down

0 comments on commit f8c99b2

Please sign in to comment.