Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Side by Side Diff: pkg/observe/lib/src/bind_property.dart

Issue 51483002: fix PathObserver to avoid try+catch (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/observe/lib/observe.dart ('k') | pkg/observe/lib/src/change_notifier.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of observe; 5 library observe.src.bind_property;
6
7 import 'dart:async';
8 import 'package:observe/observe.dart';
6 9
7 /** 10 /**
8 * Forwards an observable property from one object to another. For example: 11 * Forwards an observable property from one object to another. For example:
9 * 12 *
10 * class MyModel extends Observable { 13 * class MyModel extends Observable {
11 * StreamSubscription _sub; 14 * StreamSubscription _sub;
12 * MyOtherModel _otherModel; 15 * MyOtherModel _otherModel;
13 * 16 *
14 * MyModel() { 17 * MyModel() {
15 * ... 18 * ...
(...skipping 13 matching lines...) Expand all
29 return source.changes.listen((records) { 32 return source.changes.listen((records) {
30 for (var record in records) { 33 for (var record in records) {
31 if (record is PropertyChangeRecord && 34 if (record is PropertyChangeRecord &&
32 (record as PropertyChangeRecord).name == sourceName) { 35 (record as PropertyChangeRecord).name == sourceName) {
33 callback(); 36 callback();
34 break; 37 break;
35 } 38 }
36 } 39 }
37 }); 40 });
38 } 41 }
OLDNEW
« no previous file with comments | « pkg/observe/lib/observe.dart ('k') | pkg/observe/lib/src/change_notifier.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698