Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better module system compatibility #50

Open
micky2be opened this issue Aug 19, 2016 · 3 comments
Open

Better module system compatibility #50

micky2be opened this issue Aug 19, 2016 · 3 comments

Comments

@micky2be
Copy link

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.

@darklow
Copy link
Owner

darklow commented Aug 19, 2016

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.

@darklow
Copy link
Owner

darklow commented Dec 16, 2016

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.

@arfilon
Copy link
Contributor

arfilon commented May 10, 2017

if someone need this , i just add a pull request using this branch
https://github.com/arfilon/social-share-kit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants