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

Commit

Permalink
fix(HttpConfig): Remove the optional argument to the default ctor
Browse files Browse the repository at this point in the history
Because this is not currently supported by the Dependency injection.
A new HttpConfig.withOptions() ctor has been added.

Closes #1285
  • Loading branch information
vicb committed Aug 1, 2014
1 parent 879772f commit 9810c9b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion lib/core_dom/http.dart
Original file line number Diff line number Diff line change
Expand Up @@ -755,5 +755,7 @@ class Http {
class HttpConfig {
final Duration coalesceDuration;

HttpConfig({this.coalesceDuration});
HttpConfig(): coalesceDuration = null;

HttpConfig.withOptions({this.coalesceDuration});
}
2 changes: 1 addition & 1 deletion lib/core_dom/module_internal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class CoreDomModule extends Module {
bind(HttpDefaultHeaders);
bind(HttpDefaults);
bind(HttpInterceptors);
bind(HttpConfig, toValue: new HttpConfig());
bind(HttpConfig);
bind(Animate);
bind(ViewCache);
bind(BrowserCookies);
Expand Down
4 changes: 2 additions & 2 deletions test/core_dom/http_spec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1426,8 +1426,8 @@ void main() {

describe('coalesce', () {
beforeEachModule((Module module) {
var coalesceDuration = new Duration(milliseconds: 100);
module.bind(HttpConfig, toValue: new HttpConfig(coalesceDuration: coalesceDuration));
var duration = new Duration(milliseconds: 100);
module.bind(HttpConfig, toValue: new HttpConfig.withOptions(coalesceDuration: duration));
});

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

0 comments on commit 9810c9b

Please sign in to comment.