Reputation: 17362
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?
Upvotes: 3
Views: 748
Reputation: 27793
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.
Upvotes: 3