Skip to content

Commit 050e6e0

Browse files
committed
Put previous signatures back as deprecated
1 parent 8c6fc68 commit 050e6e0

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

Sources/Futures/Future.swift

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,14 @@ public extension Future {
292292
return promise.future
293293
}
294294

295+
/// :nodoc:
296+
@available(*, deprecated, renamed: "flatMap")
297+
func then<NewValue>(
298+
on queue: DispatchQueue = .futures,
299+
callback: @escaping (_ value: Value) -> Future<NewValue>) -> Future<NewValue> {
300+
flatMap(on: queue, callback: callback)
301+
}
302+
295303
/// When the current `Future` is rejected, run the provided callback reurning a new `Future<Value>`.
296304
///
297305
/// 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 {
328336
return promise.future
329337
}
330338

339+
/// :nodoc:
340+
@available(*, deprecated, renamed: "flatMapIfRejected")
341+
func thenIfRejected(
342+
on queue: DispatchQueue = .futures,
343+
callback: @escaping(Error) -> Future<Value>) -> Future<Value> {
344+
flatMapIfRejected(on: queue, callback: callback)
345+
}
346+
331347
/// When the current `Future` is fulfilled, run the provided callback returning a fulfilled value of the
332348
/// `Future<NewValue>` returned by this method.
333349
///
@@ -350,6 +366,14 @@ public extension Future {
350366
}
351367
}
352368

369+
/// :nodoc:
370+
@available(*, deprecated, renamed: "flatMapThrowing")
371+
func thenThrowing<NewValue>(
372+
on queue: DispatchQueue = .futures,
373+
callback: @escaping (Value) throws -> NewValue) -> Future<NewValue> {
374+
flatMapThrowing(on: queue, callback: callback)
375+
}
376+
353377
/// When the current `Future` is fulfilled, run the provided callback returning a fulfilled value of the
354378
/// `Future<NewValue>` returned by this method.
355379
///

docs/docsets/.tgz

3 Bytes
Binary file not shown.

docs/undocumented.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
{
1818
"file": "/Users/davidask/Github/formbound/Futures/Sources/Futures/Future.swift",
19-
"line": 404,
19+
"line": 428,
2020
"symbol": "Future.mapIfRejected(on:callback:)",
2121
"symbol_kind": "source.lang.swift.decl.function.method.instance",
2222
"warning": "undocumented"

0 commit comments

Comments
 (0)