diff --git a/CHANGELOG.md b/CHANGELOG.md index f00dd055..5905336d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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`. diff --git a/lib/src/middleware_pipeline.dart b/lib/src/middleware_pipeline.dart index bdf52158..afb1b9e4 100644 --- a/lib/src/middleware_pipeline.dart +++ b/lib/src/middleware_pipeline.dart @@ -21,3 +21,18 @@ class MiddlewarePipeline { MiddlewarePipeline(Iterable> routingResults) : this.routingResults = routingResults.toList(); } + +/// Iterates through a [MiddlewarePipeline]. +class MiddlewarePipelineIterator extends Iterator> { + final MiddlewarePipeline pipeline; + final Iterator> _inner; + + MiddlewarePipelineIterator(this.pipeline) + : _inner = pipeline.routingResults.iterator; + + @override + RoutingResult get current => _inner.current; + + @override + bool moveNext() => _inner.moveNext(); +} diff --git a/pubspec.yaml b/pubspec.yaml index 1a212034..3e4cf386 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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 homepage: https://github.com/angel-dart/angel_route environment: