findServiceOf
This commit is contained in:
parent
10b6011aba
commit
681e2ac596
2 changed files with 7 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
||||||
* Add `readMany` to `Service`.
|
* Add `readMany` to `Service`.
|
||||||
* Allow `ResponseContext.redirect` to take a `Uri`.
|
* Allow `ResponseContext.redirect` to take a `Uri`.
|
||||||
* Add `Angel.mountController`.
|
* Add `Angel.mountController`.
|
||||||
|
* Add `Angel.findServiceOf`.
|
||||||
|
|
||||||
# 2.0.0-alpha.10
|
# 2.0.0-alpha.10
|
||||||
* All calls to `Service.parseId` are now affixed with the `<Id>` argument.
|
* All calls to `Service.parseId` are now affixed with the `<Id>` argument.
|
||||||
|
|
|
@ -81,7 +81,12 @@ class Routable extends Router<RequestHandler> {
|
||||||
}) as T;
|
}) as T;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Shorthand for finding a [HookedService] in a statically-typed
|
/// Shorthand for finding a [Service] in a statically-typed manner.
|
||||||
|
Service<Id, Data> findServiceOf<Id, Data>(Pattern path) {
|
||||||
|
return findService<Service<Id, Data>>(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Shorthand for finding a [HookedService] in a statically-typed manner.
|
||||||
HookedService<dynamic, dynamic, T> findHookedService<T extends Service>(
|
HookedService<dynamic, dynamic, T> findHookedService<T extends Service>(
|
||||||
Pattern path) {
|
Pattern path) {
|
||||||
return findService(path) as HookedService<dynamic, dynamic, T>;
|
return findService(path) as HookedService<dynamic, dynamic, T>;
|
||||||
|
|
Loading…
Reference in a new issue