| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
| 6 * A library to observe changes on Dart objects. | 6 * A library to observe changes on Dart objects. |
| 7 * | 7 * |
| 8 * Similar to the principle of watchers in AngularJS, this library provides the | 8 * Similar to the principle of watchers in AngularJS, this library provides the |
| 9 * mechanisms to observe and react to changes that happen in an application's | 9 * mechanisms to observe and react to changes that happen in an application's |
| 10 * data model. | 10 * data model. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 * | 39 * |
| 40 * You can watch several kinds of expressions, including lists. See [watch] for | 40 * You can watch several kinds of expressions, including lists. See [watch] for |
| 41 * more details. | 41 * more details. |
| 42 * | 42 * |
| 43 * A common design pattern for MVC applications is to call [dispatch] at the end | 43 * A common design pattern for MVC applications is to call [dispatch] at the end |
| 44 * of each event loop (e.g. after each UI event is fired). Our view library does | 44 * of each event loop (e.g. after each UI event is fired). Our view library does |
| 45 * this automatically. | 45 * this automatically. |
| 46 */ | 46 */ |
| 47 library watcher; | 47 library watcher; |
| 48 | 48 |
| 49 import 'dart:async'; | |
| 50 import 'dart:collection' hide LinkedList, LinkedListEntry; | 49 import 'dart:collection' hide LinkedList, LinkedListEntry; |
| 51 import 'observe.dart'; | 50 import 'observe.dart'; |
| 52 import 'src/linked_list.dart'; | 51 import 'src/linked_list.dart'; |
| 53 import 'package:logging/logging.dart'; | 52 import 'package:logging/logging.dart'; |
| 54 | 53 |
| 55 /** | 54 /** |
| 56 * True to use the [observe] library instead of watchers. | 55 * True to use the [observe] library instead of watchers. |
| 57 * | 56 * |
| 58 * Observers require the [observable] annotation on objects and for collection | 57 * Observers require the [observable] annotation on objects and for collection |
| 59 * types to be observable, such as [ObservableList]. But in return they offer | 58 * types to be observable, such as [ObservableList]. But in return they offer |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 class _WatcherType { | 470 class _WatcherType { |
| 472 final _value; | 471 final _value; |
| 473 const _WatcherType._internal(this._value); | 472 const _WatcherType._internal(this._value); |
| 474 toString() => 'Enum.$_value'; | 473 toString() => 'Enum.$_value'; |
| 475 | 474 |
| 476 static const LIST = const _WatcherType._internal('LIST'); | 475 static const LIST = const _WatcherType._internal('LIST'); |
| 477 static const HASH_MAP = const _WatcherType._internal('HASH_MAP'); | 476 static const HASH_MAP = const _WatcherType._internal('HASH_MAP'); |
| 478 static const ORDERED_MAP = const _WatcherType._internal('ORDERED_MAP'); | 477 static const ORDERED_MAP = const _WatcherType._internal('ORDERED_MAP'); |
| 479 static const OTHER = const _WatcherType._internal('OTHER'); | 478 static const OTHER = const _WatcherType._internal('OTHER'); |
| 480 } | 479 } |
| OLD | NEW |