mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-23 01:06:21 +01:00
15 lines
288 B
Dart
15 lines
288 B
Dart
import 'dart:async';
|
|
|
|
extension ObjectExtension<T> on T {
|
|
T apply(void Function(T obj) fn) {
|
|
fn(this);
|
|
return this;
|
|
}
|
|
|
|
Future<T> applyFuture(FutureOr<void> Function(T obj) fn) async {
|
|
await fn(this);
|
|
return this;
|
|
}
|
|
|
|
U run<U>(U Function(T obj) fn) => fn(this);
|
|
}
|