2021-12-03 18:31:27 +01:00
|
|
|
import 'dart:async';
|
2023-10-03 16:28:35 +02:00
|
|
|
import 'package:np_common/object_util.dart';
|
2021-12-03 18:31:27 +01:00
|
|
|
|
2021-11-11 18:03:36 +01:00
|
|
|
extension ObjectExtension<T> on T {
|
2023-10-03 16:28:35 +02:00
|
|
|
/// Deprecated, use [also]
|
|
|
|
T apply(void Function(T obj) fn) => also(fn);
|
2021-12-03 18:31:27 +01:00
|
|
|
|
2023-10-03 16:28:35 +02:00
|
|
|
/// Deprecated, use [alsoFuture]
|
|
|
|
Future<T> applyFuture(FutureOr<void> Function(T obj) fn) => alsoFuture(fn);
|
2021-12-05 12:03:59 +01:00
|
|
|
|
2023-10-03 16:28:35 +02:00
|
|
|
/// Deprecated, use [let]
|
|
|
|
U run<U>(U Function(T obj) fn) => let(fn);
|
2022-01-01 21:34:40 +01:00
|
|
|
|
2023-10-03 16:28:35 +02:00
|
|
|
/// Deprecated, use [letFuture]
|
|
|
|
Future<U> runFuture<U>(FutureOr<U> Function(T obj) fn) => letFuture(fn);
|
2021-11-11 18:03:36 +01:00
|
|
|
}
|