Open christianbundy opened 4 years ago
This feels like a very silly question, but why don't each of these module just encode their own defaults? The more time I spend thinking about this pattern, the more of an antipattern it feels like.
const ssbConfig = () => ({ foo: 42 }); const ssbFoo = (config) => { console.log(config.foo); }; ssbFoo(ssbConfig());
const ssbFoo = (config) => { if (config.foo === undefined) { config.foo = 42; } console.log(config.foo); } ssbFoo();
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This feels like a very silly question, but why don't each of these module just encode their own defaults? The more time I spend thinking about this pattern, the more of an antipattern it feels like.
Current implementtion
"Proposal"