Skip to content

Commit 157000a

Browse files
vicbdsalsbury
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 dart-archive#1285
1 parent 8a1c158 commit 157000a

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

lib/core_dom/http.dart

Lines changed: 2 additions & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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)