From c8a621a9535d9a7ffbfaa219f6b6c4df41868a0c Mon Sep 17 00:00:00 2001 From: Tobe O Date: Sun, 3 Feb 2019 13:28:25 -0500 Subject: [PATCH] pipeline iter --- CHANGELOG.md | 3 +++ lib/src/middleware_pipeline.dart | 15 +++++++++++++++ pubspec.yaml | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) 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: