pipeline iter
This commit is contained in:
parent
0f529c5625
commit
c8a621a953
3 changed files with 19 additions and 1 deletions
|
@ -1,3 +1,6 @@
|
|||
# 3.0.5
|
||||
* Add `MiddlewarePipelineIterator`.
|
||||
|
||||
# 3.0.4
|
||||
* Add `RouteResult` class, which allows segments (i.e. wildcard) to
|
||||
modify the `tail`.
|
||||
|
|
|
@ -21,3 +21,18 @@ class MiddlewarePipeline<T> {
|
|||
MiddlewarePipeline(Iterable<RoutingResult<T>> routingResults)
|
||||
: this.routingResults = routingResults.toList();
|
||||
}
|
||||
|
||||
/// Iterates through a [MiddlewarePipeline].
|
||||
class MiddlewarePipelineIterator<T> extends Iterator<RoutingResult<T>> {
|
||||
final MiddlewarePipeline<T> pipeline;
|
||||
final Iterator<RoutingResult<T>> _inner;
|
||||
|
||||
MiddlewarePipelineIterator(this.pipeline)
|
||||
: _inner = pipeline.routingResults.iterator;
|
||||
|
||||
@override
|
||||
RoutingResult<T> get current => _inner.current;
|
||||
|
||||
@override
|
||||
bool moveNext() => _inner.moveNext();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: angel_route
|
||||
description: A powerful, isomorphic routing library for Dart. It is mainly used in the Angel framework, but can be used in Flutter and on the Web.
|
||||
version: 3.0.4
|
||||
version: 3.0.5
|
||||
author: Tobe O <thosakwe@gmail.com>
|
||||
homepage: https://github.com/angel-dart/angel_route
|
||||
environment:
|
||||
|
|
Loading…
Reference in a new issue