pipeline iter

This commit is contained in:
Tobe O 2019-02-03 13:28:25 -05:00
parent 0f529c5625
commit c8a621a953
3 changed files with 19 additions and 1 deletions

View file

@ -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`.

View file

@ -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();
}

View file

@ -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: