Skip to content

Instantly share code, notes, and snippets.

@RdeWilde
Created July 23, 2018 21:32
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 RdeWilde/3a259aefbf21ce887632d220d4027d5d to your computer and use it in GitHub Desktop.
Save RdeWilde/3a259aefbf21ce887632d220d4027d5d to your computer and use it in GitHub Desktop.
ObservableList<Peer> sub = toObservable(server.peers) as ObservableList<Peer>;
sub.changes.listen((l) {
print('Changes');
});
sub.listChanges.listen((l) {
print('List');
});
server.peers.add(new Peer());
new Timer.periodic(new Duration(seconds: 5), (t) {
server.peers.add(new Peer());
print('Timer');
}); // Print 'Timer' but not 'Changes' nor 'List'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment