Skip to content

Instantly share code, notes, and snippets.

@llamadonica
Created March 12, 2017 23:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save llamadonica/b3354cff87574915860ef5a54a48b27e to your computer and use it in GitHub Desktop.
Save llamadonica/b3354cff87574915860ef5a54a48b27e to your computer and use it in GitHub Desktop.
void main() {
final test = new Test();
for (var func in doEverything()) {
func(test);
}
assert(test.foo == 'bar');
}
class Test {
String foo;
}
typedef void VoidFunction(Test test);
Iterable<VoidFunction> doEverything() sync* {
yield (Test test) {test.foo = 'bar';};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment