From cfc5991fffa3f749b8d4df0d712e6de5ea68d8f6 Mon Sep 17 00:00:00 2001 From: Tobe O Date: Mon, 20 Aug 2018 15:52:44 -0400 Subject: [PATCH] Remove req.inject --- CHANGELOG.md | 5 +++-- lib/src/core/request_context.dart | 11 ----------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb9d4309..84bdedc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,7 +30,8 @@ replaced with `parseBody`, `parseUploadedFiles`, and `parseRawRequestBuffer`, re * Removed the synchronous equivalents of the above methods (`body`, `files`, and `originalBuffer`), as well as `query`. * Removed `Angel.injections` and `RequestContext.injections`. -* Removed `Angel.inject`. +* Removed `Angel.inject` and `RequestContext.inject`. * Removed a dependency on `package:pool`, which also meant removing `AngelHttp.throttle`. * Remove the `RequestMiddleware` typedef; from now on, one should use `ResponseContext.end` -exclusively to close responses. \ No newline at end of file +exclusively to close responses. +* `waterfall` will now only accept `RequestHandler`. \ No newline at end of file diff --git a/lib/src/core/request_context.dart b/lib/src/core/request_context.dart index 38c6dad3..32e8e2af 100644 --- a/lib/src/core/request_context.dart +++ b/lib/src/core/request_context.dart @@ -112,17 +112,6 @@ abstract class RequestContext { } } - /// Shorthand to add to [_injections]. - void inject(type, value) { - if (!app.isProduction && type is Type) { - if (!reflect(value).type.isAssignableTo(reflectType(type))) - throw new ArgumentError( - 'Cannot inject $value (${value.runtimeType}) as an instance of $type.'); - } - - _injections[type] = value; - } - /// Returns `true` if the client's `Accept` header indicates that the given [contentType] is considered a valid response. /// /// You cannot provide a `null` [contentType].