{"action":"created","issue":{"url":"https://api.github.com/repos/lorenwest/node-config/issues/351","repository_url":"https://api.github.com/repos/lorenwest/node-config","labels_url":"https://api.github.com/repos/lorenwest/node-config/issues/351/labels{/name}","comments_url":"https://api.github.com/repos/lorenwest/node-config/issues/351/comments","events_url":"https://api.github.com/repos/lorenwest/node-config/issues/351/events","html_url":"https://github.com/lorenwest/node-config/pull/351","id":184519262,"number":351,"title":"original/previous value for deferredConfig","user":{"login":"simon-scherzinger","id":2529835,"avatar_url":"https://avatars.githubusercontent.com/u/2529835?v=3","gravatar_id":"","url":"https://api.github.com/users/simon-scherzinger","html_url":"https://github.com/simon-scherzinger","followers_url":"https://api.github.com/users/simon-scherzinger/followers","following_url":"https://api.github.com/users/simon-scherzinger/following{/other_user}","gists_url":"https://api.github.com/users/simon-scherzinger/gists{/gist_id}","starred_url":"https://api.github.com/users/simon-scherzinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simon-scherzinger/subscriptions","organizations_url":"https://api.github.com/users/simon-scherzinger/orgs","repos_url":"https://api.github.com/users/simon-scherzinger/repos","events_url":"https://api.github.com/users/simon-scherzinger/events{/privacy}","received_events_url":"https://api.github.com/users/simon-scherzinger/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-10-21T15:49:02Z","updated_at":"2016-10-25T16:41:56Z","closed_at":"2016-10-25T14:46:41Z","pull_request":{"url":"https://api.github.com/repos/lorenwest/node-config/pulls/351","html_url":"https://github.com/lorenwest/node-config/pull/351","diff_url":"https://github.com/lorenwest/node-config/pull/351.diff","patch_url":"https://github.com/lorenwest/node-config/pull/351.patch"},"body":"I would like to suggest this PR to extend functionality for deferredConfigs. This PR is fully backward compatible.\r\n\r\nWhen merging a config file which has deferred values the value from the previous file is saved into the DeferredConfig object. Later when deferred values are resolved this saved value is passed to the resolver function.\r\n\r\nI am currently developing a deferred resolver which allows me to load values from etcd – hopefully I will be able to release this in the next week. Yes, it is synchronously but this is ok in my context. When no value is in etcd I wanted to get the last one so I did this little change.\r\n\r\nMaybe some other people are in need of this? :)\r\n\r\nHere is an example:\r\n\r\n```yaml\r\n# default.yml\r\nsomeValue: default\r\n```\r\n\r\n```js\r\n// local.js\r\nmodule.exports = {\r\n  someValue: defer(function (cfg, original) {\r\n    return getSomeFancyConfigOrUndefined() || original;\r\n  }\r\n}\r\n```\r\n\r\nWhen `getSomeFancyConfigORUndefined` is not able to get a value, we are able to use the `original` value now."},"comment":{"url":"https://api.github.com/repos/lorenwest/node-config/issues/comments/256090579","html_url":"https://github.com/lorenwest/node-config/pull/351#issuecomment-256090579","issue_url":"https://api.github.com/repos/lorenwest/node-config/issues/351","id":256090579,"user":{"login":"lorenwest","id":373538,"avatar_url":"https://avatars.githubusercontent.com/u/373538?v=3","gravatar_id":"","url":"https://api.github.com/users/lorenwest","html_url":"https://github.com/lorenwest","followers_url":"https://api.github.com/users/lorenwest/followers","following_url":"https://api.github.com/users/lorenwest/following{/other_user}","gists_url":"https://api.github.com/users/lorenwest/gists{/gist_id}","starred_url":"https://api.github.com/users/lorenwest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorenwest/subscriptions","organizations_url":"https://api.github.com/users/lorenwest/orgs","repos_url":"https://api.github.com/users/lorenwest/repos","events_url":"https://api.github.com/users/lorenwest/events{/privacy}","received_events_url":"https://api.github.com/users/lorenwest/received_events","type":"User","site_admin":false},"created_at":"2016-10-25T16:41:56Z","updated_at":"2016-10-25T16:41:56Z","body":"Published 10/25 in 1.22.0"}}
{"actor":{"display_login":"lorenwest"}}