OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 library observable; | 5 library observable; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 part 'ChangeEvent.dart'; | 9 part 'ChangeEvent.dart'; |
10 part 'EventBatch.dart'; | 10 part 'EventBatch.dart'; |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 | 295 |
296 // Collection<T>: | 296 // Collection<T>: |
297 Iterable<T> where(bool f(T element)) => _internal.where(f); | 297 Iterable<T> where(bool f(T element)) => _internal.where(f); |
298 Iterable map(f(T element)) => _internal.map(f); | 298 Iterable map(f(T element)) => _internal.map(f); |
299 Iterable expand(Iterable f(T element)) => _internal.expand(f); | 299 Iterable expand(Iterable f(T element)) => _internal.expand(f); |
300 List<T> skip(int count) => _internal.skip(count); | 300 List<T> skip(int count) => _internal.skip(count); |
301 List<T> take(int count) => _internal.take(count); | 301 List<T> take(int count) => _internal.take(count); |
302 bool every(bool f(T element)) => _internal.every(f); | 302 bool every(bool f(T element)) => _internal.every(f); |
303 bool any(bool f(T element)) => _internal.any(f); | 303 bool any(bool f(T element)) => _internal.any(f); |
304 void forEach(void f(T element)) { _internal.forEach(f); } | 304 void forEach(void f(T element)) { _internal.forEach(f); } |
305 String join([String separator]) => _internal.join(separator); | 305 String join([String separator = ""]) => _internal.join(separator); |
306 T firstWhere(bool test(T value), {T orElse()}) { | 306 T firstWhere(bool test(T value), {T orElse()}) { |
307 return _internal.firstWhere(test, orElse: orElse); | 307 return _internal.firstWhere(test, orElse: orElse); |
308 } | 308 } |
309 T lastWhere(bool test(T value), {T orElse()}) { | 309 T lastWhere(bool test(T value), {T orElse()}) { |
310 return _internal.lastWhere(test, orElse: orElse); | 310 return _internal.lastWhere(test, orElse: orElse); |
311 } | 311 } |
312 T singleWhere(bool test(T value)) { | 312 T singleWhere(bool test(T value)) { |
313 return _internal.singleWhere(test); | 313 return _internal.singleWhere(test); |
314 } | 314 } |
315 T elementAt(int index) { | 315 T elementAt(int index) { |
(...skipping 23 matching lines...) Expand all Loading... |
339 // Only fire on an actual change. | 339 // Only fire on an actual change. |
340 if (!identical(newValue, _value)) { | 340 if (!identical(newValue, _value)) { |
341 final oldValue = _value; | 341 final oldValue = _value; |
342 _value = newValue; | 342 _value = newValue; |
343 recordPropertyUpdate("value", newValue, oldValue); | 343 recordPropertyUpdate("value", newValue, oldValue); |
344 } | 344 } |
345 } | 345 } |
346 | 346 |
347 T _value; | 347 T _value; |
348 } | 348 } |
OLD | NEW |