Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit 9810c9b

Browse files
committed
fix(HttpConfig): Remove the optional argument to the default ctor
Because this is not currently supported by the Dependency injection. A new HttpConfig.withOptions() ctor has been added. Closes #1285
1 parent 879772f commit 9810c9b

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

lib/core_dom/http.dart

+3-1
Original file line numberDiff line numberDiff line change
@@ -755,5 +755,7 @@ class Http {
755755
class HttpConfig {
756756
final Duration coalesceDuration;
757757

758-
HttpConfig({this.coalesceDuration});
758+
HttpConfig(): coalesceDuration = null;
759+
760+
HttpConfig.withOptions({this.coalesceDuration});
759761
}

lib/core_dom/module_internal.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class CoreDomModule extends Module {
8686
bind(HttpDefaultHeaders);
8787
bind(HttpDefaults);
8888
bind(HttpInterceptors);
89-
bind(HttpConfig, toValue: new HttpConfig());
89+
bind(HttpConfig);
9090
bind(Animate);
9191
bind(ViewCache);
9292
bind(BrowserCookies);

test/core_dom/http_spec.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -1426,8 +1426,8 @@ void main() {
14261426

14271427
describe('coalesce', () {
14281428
beforeEachModule((Module module) {
1429-
var coalesceDuration = new Duration(milliseconds: 100);
1430-
module.bind(HttpConfig, toValue: new HttpConfig(coalesceDuration: coalesceDuration));
1429+
var duration = new Duration(milliseconds: 100);
1430+
module.bind(HttpConfig, toValue: new HttpConfig.withOptions(coalesceDuration: duration));
14311431
});
14321432

14331433
it('should coalesce requests', async((Http http) {

0 commit comments

Comments
 (0)