{"action":"created","issue":{"url":"https://api.github.com/repos/aurelia/fetch-client/issues/11","labels_url":"https://api.github.com/repos/aurelia/fetch-client/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/aurelia/fetch-client/issues/11/comments","events_url":"https://api.github.com/repos/aurelia/fetch-client/issues/11/events","html_url":"https://github.com/aurelia/fetch-client/pull/11","id":101917885,"number":11,"title":"[WIP] Make the API immutable","user":{"login":"Alxandr","id":112334,"avatar_url":"https://avatars.githubusercontent.com/u/112334?v=3","gravatar_id":"","url":"https://api.github.com/users/Alxandr","html_url":"https://github.com/Alxandr","followers_url":"https://api.github.com/users/Alxandr/followers","following_url":"https://api.github.com/users/Alxandr/following{/other_user}","gists_url":"https://api.github.com/users/Alxandr/gists{/gist_id}","starred_url":"https://api.github.com/users/Alxandr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alxandr/subscriptions","organizations_url":"https://api.github.com/users/Alxandr/orgs","repos_url":"https://api.github.com/users/Alxandr/repos","events_url":"https://api.github.com/users/Alxandr/events{/privacy}","received_events_url":"https://api.github.com/users/Alxandr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-08-19T15:17:26Z","updated_at":"2015-08-24T15:07:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/aurelia/fetch-client/pulls/11","html_url":"https://github.com/aurelia/fetch-client/pull/11","diff_url":"https://github.com/aurelia/fetch-client/pull/11.diff","patch_url":"https://github.com/aurelia/fetch-client/pull/11.patch"},"body":"```js\r\nvar conf = new Conf();\r\nvar withBaseUrl = conf.withBaseUrl(‘foo’);\r\nvar withOtherBaseUrl = conf.withBaseUrl(‘other’);\r\n\r\nconsole.log(withBaseUrl.baseUrl); // => \"other\", WTF?\r\n```\r\n\r\nNote, this is a rudimentary suggestion. It's not been tested (I think maybe the order of my `...this._options` is wrong), but I'm on a borrowed PC which doesn't have NPM or node (and my PC is away for service :-/), so I've just changed this in-browser.\r\n\r\nThe main point is to show how I think the API should look. For most people this will not affect anything at all, but it allows you to do stuff like this:\r\n\r\n```js\r\nvar serverConfig = new Config().withBaseUrl('blah');\r\nvar loginConfig = serverConfig.withDefaults({'some-secret': 'some-value'});\r\n```"},"comment":{"url":"https://api.github.com/repos/aurelia/fetch-client/issues/comments/134238503","html_url":"https://github.com/aurelia/fetch-client/pull/11#issuecomment-134238503","issue_url":"https://api.github.com/repos/aurelia/fetch-client/issues/11","id":134238503,"user":{"login":"EisenbergEffect","id":131485,"avatar_url":"https://avatars.githubusercontent.com/u/131485?v=3","gravatar_id":"","url":"https://api.github.com/users/EisenbergEffect","html_url":"https://github.com/EisenbergEffect","followers_url":"https://api.github.com/users/EisenbergEffect/followers","following_url":"https://api.github.com/users/EisenbergEffect/following{/other_user}","gists_url":"https://api.github.com/users/EisenbergEffect/gists{/gist_id}","starred_url":"https://api.github.com/users/EisenbergEffect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EisenbergEffect/subscriptions","organizations_url":"https://api.github.com/users/EisenbergEffect/orgs","repos_url":"https://api.github.com/users/EisenbergEffect/repos","events_url":"https://api.github.com/users/EisenbergEffect/events{/privacy}","received_events_url":"https://api.github.com/users/EisenbergEffect/received_events","type":"User","site_admin":false},"created_at":"2015-08-24T15:07:02Z","updated_at":"2015-08-24T15:07:02Z","body":"I thought we would just avoid using `add`. But maybe we can't? @bryanrsmith Any thoughts?"}}