Closed maelgrove closed 1 year ago
I've created a branch for this over here: config/values-to-origin however I'm not quite sure whether to pursue this any further. On one side, it fits the principle of least surprise, as configuration values which originally haven't been defined in a configuration store won't be stored everywhere upon setting them. However, that way it will not be possible to set a configuration value at all if it isn't defined somewhere, which is why a lot of the tests break.
Nah, that would make things very complicated.
The current implementation stores each change into every
IConfigStore
registered when setting a configuration value, which absolutely makes no sense since you wouldn't want to have your persistent file configuration values end up in a more temporary location, like the environment variables upon setting them. The library should keep track of where a certain configuration value has been retrieved from (using an internal dictionary which maps keys to configuration stores) and only persist them based on their origin.