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