Closed mikee47 closed 2 months ago
can I trigger the reset
from the importFromStream
? I was thinking about how to reset a property to default from the frontend.
Yes, set the property to null
.
You'll have to read it back again to get the actual values of course.
Objects and arrays can be reset (PR #37) but as per https://github.com/mikee47/ConfigDB/discussions/20#discussioncomment-10471624 there is currently no specific way to reset property values to their default. This PR adds
resetXXXX()
methods to generated updater code for this purpose.Objects have a defined
defaultData
structure which contains the default values and can be useful for introspection. These could be used to reset default values, but the types do not always agree with those in the API and doing it this way is a bit clunky.