This is how I define some ReactiveDict variable:
this.templateDictionary = new ReactiveDict();
this.templateDictionary.set( 'type', type );
this.templateDictionary.set( 'size', size );
this.templateDictionary.set( 'bgcolor', bgcolor );
this.templateDictionary.set( 'color', color );
Now I want to remove everything:
this.templateDictionary.set( 'type', undefined );
this.templateDictionary.set( 'size', undefined );
this.templateDictionary.set( 'bgcolor', undefined );
this.templateDictionary.set( 'color', undefined );
But if I do a console.log, I see the variable get the string undefined. So it isn't really removed.
And by the way: Is it possible to set multiple values by one line?
What you want is:
this.templateDictionary.delete('type');
Though printing it out will still show undefined, but this is normal.
To delete all keys in your dictionary:
this.templateDictionary.clear();
For a list of all the functions in ReactiveDict, check this out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With