From 224a850dcd45ef169dce6af574d21bcc5891cba9 Mon Sep 17 00:00:00 2001 From: iapicca Date: Fri, 6 Sep 2024 14:18:10 +0300 Subject: [PATCH] rework runner iterable --- .../lib/src/extension/iterable_run.dart | 65 +++++-------------- 1 file changed, 16 insertions(+), 49 deletions(-) diff --git a/packages/yak_runner/lib/src/extension/iterable_run.dart b/packages/yak_runner/lib/src/extension/iterable_run.dart index 80c601fb..5e65938a 100644 --- a/packages/yak_runner/lib/src/extension/iterable_run.dart +++ b/packages/yak_runner/lib/src/extension/iterable_run.dart @@ -6,78 +6,45 @@ import 'run.dart'; extension IterableNullaryToResultNullaryX on Iterable> { /// returns Iterable> from Iterable> - /// TODO REWORK ITERATOR https://github.com/yakforward-ou/yak_packages/issues/238 - Iterable> get run sync* { - for (final function in this) { - yield function.run; - } - } + Iterable> get run => + [for (final function in this) function.run]; /// returns Iterable from Iterable> - /// TODO REWORK ITERATOR https://github.com/yakforward-ou/yak_packages/issues/238 - Iterable get runVoid sync* { - for (final function in this) { - yield function.runVoid; - } - } + Iterable get runVoid => + [for (final function in this) function.runVoid]; } extension IterableUnaryToResultUnaryX on Iterable> { /// returns Iterable> from Iterable> - /// TODO REWORK ITERATOR https://github.com/yakforward-ou/yak_packages/issues/238 - Iterable> get run sync* { - for (final function in this) { - yield function.run; - } - } + Iterable> get run => + [for (final function in this) function.run]; } extension IterableUnaryToResultUnaryVoidX on Iterable> { /// returns Iterable> from Iterable> - /// TODO REWORK ITERATOR https://github.com/yakforward-ou/yak_packages/issues/238 - Iterable> get runVoid sync* { - for (final function in this) { - yield function.runVoid; - } - } + Iterable> get runVoid => + [for (final function in this) function.runVoid]; } extension IterableNullaryToResultNullaryAsyncX on Iterable> { /// returns Iterable> from Iterable> - /// TODO REWORK ITERATOR https://github.com/yakforward-ou/yak_packages/issues/238 - Iterable> get runAsync sync* { - for (final function in this) { - yield function.runAsync; - } - } + Iterable> get runAsync => + [for (final function in this) function.runAsync]; /// returns Iterable from Iterable> - /// TODO REWORK ITERATOR https://github.com/yakforward-ou/yak_packages/issues/238 - - Iterable get runVoidAsync sync* { - for (final function in this) { - yield function.runVoidAsync; - } - } + Iterable get runVoidAsync => + [for (final function in this) function.runVoidAsync]; } extension IterableUnaryToResultUnaryAsyncX on Iterable> { /// returns Iterable> from Iterable> - /// TODO REWORK ITERATOR https://github.com/yakforward-ou/yak_packages/issues/238 - Iterable> get runAsync sync* { - for (final function in this) { - yield function.runAsync; - } - } + Iterable> get runAsync => + [for (final function in this) function.runAsync]; /// returns Iterable> from Iterable> - /// TODO REWORK ITERATOR https://github.com/yakforward-ou/yak_packages/issues/238 - Iterable> get runVoidAsync sync* { - for (final function in this) { - yield function.runVoidAsync; - } - } + Iterable> get runVoidAsync => + [for (final function in this) function.runVoidAsync]; }