Skip to content

Instantly share code, notes, and snippets.

@shyndman
Last active March 12, 2020 04:30
Show Gist options
  • Select an option

  • Save shyndman/4541ffc0e8ec013dd21a8b504d2eef05 to your computer and use it in GitHub Desktop.

Select an option

Save shyndman/4541ffc0e8ec013dd21a8b504d2eef05 to your computer and use it in GitHub Desktop.
class observable {
const observable(this.comparator);
final bool Function(Object a, Object b) comparator;
}
bool standardEquality(Object a, Object b) => a == b;
class Foo {
@observable(standardEquality)
bool flag;
@observable(Foo.equals)
Foo child;
static bool equals(Object a, Object b) => a == b;
}
void main() {
final foo = Foo();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment