diff --git a/Sources/Futures/Future.swift b/Sources/Futures/Future.swift index f0e1236..e74b6df 100644 --- a/Sources/Futures/Future.swift +++ b/Sources/Futures/Future.swift @@ -292,6 +292,14 @@ public extension Future { return promise.future } + /// :nodoc: + @available(*, deprecated, renamed: "flatMap") + func then( + on queue: DispatchQueue = .futures, + callback: @escaping (_ value: Value) -> Future) -> Future { + flatMap(on: queue, callback: callback) + } + /// When the current `Future` is rejected, run the provided callback reurning a new `Future`. /// /// This allows you to proceed with some other operation if the current `Future` was rejected, due to an error @@ -328,6 +336,14 @@ public extension Future { return promise.future } + /// :nodoc: + @available(*, deprecated, renamed: "flatMapIfRejected") + func thenIfRejected( + on queue: DispatchQueue = .futures, + callback: @escaping(Error) -> Future) -> Future { + flatMapIfRejected(on: queue, callback: callback) + } + /// When the current `Future` is fulfilled, run the provided callback returning a fulfilled value of the /// `Future` returned by this method. /// @@ -350,6 +366,14 @@ public extension Future { } } + /// :nodoc: + @available(*, deprecated, renamed: "flatMapThrowing") + func thenThrowing( + on queue: DispatchQueue = .futures, + callback: @escaping (Value) throws -> NewValue) -> Future { + flatMapThrowing(on: queue, callback: callback) + } + /// When the current `Future` is fulfilled, run the provided callback returning a fulfilled value of the /// `Future` returned by this method. /// diff --git a/docs/docsets/.tgz b/docs/docsets/.tgz index 75283a5..80d82d1 100644 Binary files a/docs/docsets/.tgz and b/docs/docsets/.tgz differ diff --git a/docs/undocumented.json b/docs/undocumented.json index e0e38af..fdf0373 100644 --- a/docs/undocumented.json +++ b/docs/undocumented.json @@ -16,7 +16,7 @@ }, { "file": "/Users/davidask/Github/formbound/Futures/Sources/Futures/Future.swift", - "line": 404, + "line": 428, "symbol": "Future.mapIfRejected(on:callback:)", "symbol_kind": "source.lang.swift.decl.function.method.instance", "warning": "undocumented"