@@ -292,6 +292,14 @@ public extension Future {
292
292
return promise. future
293
293
}
294
294
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
+
295
303
/// When the current `Future` is rejected, run the provided callback reurning a new `Future<Value>`.
296
304
///
297
305
/// 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 {
328
336
return promise. future
329
337
}
330
338
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
+
331
347
/// When the current `Future` is fulfilled, run the provided callback returning a fulfilled value of the
332
348
/// `Future<NewValue>` returned by this method.
333
349
///
@@ -350,6 +366,14 @@ public extension Future {
350
366
}
351
367
}
352
368
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
+
353
377
/// When the current `Future` is fulfilled, run the provided callback returning a fulfilled value of the
354
378
/// `Future<NewValue>` returned by this method.
355
379
///
0 commit comments