Skip to main content

Add the ability to "remove" plugin data

  • November 1, 2021
  • 3 replies
  • 1709 views

Blair1

Right now, it seems like the only way to “clear” plugin data on a node is to set it to an empty string. This works fine for standalone nodes, but for instance or instance children, we lose the ability to inherit plugin data from the main component. It would be really helpful if we had an API like:

node.removePluginData("myField");

That would remove plugin data so that we could inherit from the main component

3 replies

111749
  • 12 replies
  • January 9, 2022

@Blair1 What do you want to achieve? Currently you are not able to clear plugin data on instance node itself as it awlays inherits from the main component. To clear plugin data on instance node, you would have to clear the relevant field on main component.


Blair1
  • Author
  • 6 replies
  • January 11, 2022

I’m looking to clear the data on the instance so that it inherits from the main component. For example, if I had a setup like this:

component.getPluginData("colorToken"); // returns "blue"
instance.getPluginData("colorToken");  // returns "red"

I would want to “clear” the data on instance so that I get the following:

component.getPluginData("colorToken"); // returns "blue"
instance.getPluginData("colorToken");  // returns "blue" (inherited from component)

Right now, the only thing I seem to be able to do is set the field to an empty string, which doesn’t preserve inheritence:

component.getPluginData("colorToken"); // returns "blue"
instance.getPluginData("colorToken");  // returns ""

111749
  • 12 replies
  • January 18, 2022

As far as I can test, It should preserve inheritence when you set the filed to an empty string on instance.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings