This commit is contained in:
Tobe O 2018-12-08 21:32:55 -05:00
parent 4437b21157
commit 8ae686877b
3 changed files with 7 additions and 4 deletions

View file

@ -1,3 +1,6 @@
# 3.0.1
* Make the callback in `Router.group` generically-typed.
# 3.0.0
* Make `Router` and `Route` single-parameter generic.
* Remove `package:browser` dependency.

View file

@ -35,8 +35,8 @@ class Router<T> {
List<T> get middleware => new List<T>.unmodifiable(_middleware);
Map<Pattern, Router> get mounted =>
new Map<Pattern, Router>.unmodifiable(_mounted);
Map<Pattern, Router<T>> get mounted =>
new Map<Pattern, Router<T>>.unmodifiable(_mounted);
List<Route<T>> get routes {
return _routes.fold<List<Route<T>>>([], (out, route) {
@ -163,7 +163,7 @@ class Router<T> {
///
/// Returns the created route.
/// You can also register middleware within the router.
SymlinkRoute<T> group(String path, void callback(Router router),
SymlinkRoute<T> group(String path, void callback(Router<T> router),
{Iterable<T> middleware: const [], String name: null}) {
final router = new Router<T>().._middleware.addAll(middleware);
callback(router);

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.0
version: 3.0.1
author: Tobe O <thosakwe@gmail.com>
homepage: https://github.com/angel-dart/angel_route
environment: