You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to prevent the users of my plugin to write the same boilerplate code everytime they use the plugin. I am specifically talking about the const boundingRect = element.getBoundingClientRect(); part. That could easily be abstracted away in a method in the plugin itself. That way users do not have to worry about that anymore.
I could simply do something like this for example:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
We are developing plugin with several native methods. See the docs here.
Example of using the plugin in JS:
So far so good.
I want to prevent the users of my plugin to write the same boilerplate code everytime they use the plugin. I am specifically talking about the
const boundingRect = element.getBoundingClientRect();
part. That could easily be abstracted away in a method in the plugin itself. That way users do not have to worry about that anymore.I could simply do something like this for example:
But that means a user has to import the method like so:
I would be nice if we could extend an existing native method, so that a user can just import and use it like this instead:
Is that possible?
Beta Was this translation helpful? Give feedback.
All reactions