agile-ts / agile

🌌 Global State and Logic Library for JavaScript/Typescript applications

Home Page:https://agile-ts.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

bennoinbeta opened this issue Β· comments

commented

πŸ› 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