forio / contour

Apache License 2.0
120 stars 21 forks source link

updateConfig should do a deep-merge #267

Closed narenranjit closed 6 years ago

narenranjit commented 6 years ago

Currently updateConfig just does Object.assign which makes it a problem since most of the options are nested and it's easy to accidentally turn off something while changing something else - for instance updateConfig({ line: { markers: { true } }) would remove all previously configured marker options like size etc.

The alternate/additional option to handle this is to change updateConfig to take in a function which receives current options as a parameter and returns new options, putting the onus of the deep-merge on the user. @jaimedp