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

Commit a84c0b8

Browse files
vicbchirayuk
authored andcommitted
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 f20eab2 commit a84c0b8

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

lib/core_dom/http.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -764,5 +764,6 @@ class Http {
764764
class HttpConfig {
765765
final Duration coalesceDuration;
766766

767-
HttpConfig({this.coalesceDuration});
767+
HttpConfig();
768+
HttpConfig.withOptions({this.coalesceDuration});
768769
}

lib/core_dom/module_internal.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class CoreDomModule extends Module {
8484
bind(HttpDefaultHeaders);
8585
bind(HttpDefaults);
8686
bind(HttpInterceptors);
87-
bind(HttpConfig, toValue: new HttpConfig());
87+
bind(HttpConfig);
8888
bind(Animate);
8989
bind(ViewCache);
9090
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)