social-share-kit
social-share-kit copied to clipboard
Better module system compatibility
Would be nice to add a better module system compatibility.
What I mean is that I kinda hate libraries adding themselves on the window object.
All I need is the possibility to require
or import
the module .
It also shouldn't need to parse my html during an init, but I should be able to call myself shareOnTwitter
when an action is done on an DOM of my choice.
This would make the library compatible with framework like React.
I am not familiar with neither require
or import
, so I won't be able to implement such changes.
However if you decide to make a PR, make sure this library works without require
or import
too. I kinda hate when sometimes for small script, you have to include 100x heavier dependency or some kind of package manager.
About init part, not sure what do you meant, you can call init()
whenever you feel like it, yes it will attach events to all icons at the same time, but that is the main point, to have everything automatically, it is very rare occasion to have only single twitter icon, and even then, you can specify your own selector to target only one element.
I take my words back :) I will try to make it compatible with require
and import
in nearest time and if won't take too much extra code and weight I will include it.
if someone need this , i just add a pull request using this branch https://github.com/arfilon/social-share-kit