agile-ts / agile

🌌 Global State and Logic Library for JavaScript/Typescript applications
https://agile-ts.org
MIT License
95 stars 8 forks source link

Default configurations aren't applied to `undefined` set properties in a configuration object #173

Closed bennobuilder closed 3 years ago

bennobuilder commented 3 years ago

🐛 Bug report

🤖 Current Behavior

Default properties aren't applied to undefined set properties.

// Now the default property of 'background' 
// can't be applied to the configuration object because it is set.
MY_STATE.set('jeff', {background: undefined}); 
// internal: config.background; // Returns 'undefined'

🎯 Expected behavior

Default properties should also be applied to undefined set properties.

MY_STATE.set('jeff', {background: undefined}); 
// internal: config.background; // Returns 'defaultConfig'

💡 Suggested solution(s)

see benchmarks/typescript/defineConfig