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

Can't export #11

Open
sashor opened this issue Jan 7, 2019 · 2 comments
Open

Can't export #11

sashor opened this issue Jan 7, 2019 · 2 comments

Comments

@sashor
Copy link

sashor commented Jan 7, 2019

Hello,

First, thanks for this awesome lib!
I would like to use it using "import ..." instead of including it with a script tag. Any reason why you didn't expose the function with an "export .... "?

@marrio-h
Copy link
Owner

marrio-h commented Jan 7, 2019

Hi,

Thank you @sashor, really glad you like it!

Haven't thought of it tbh. I really should've been working a bit more on it, but if you want to update it please feel free to do so :)

@sashor sashor changed the title Add export Can't export Jan 10, 2019
@sashor
Copy link
Author

sashor commented Jan 10, 2019

I wasn't sure how to achieve what I need while keeping the vanilla js simplicity of your lib (👌), without making it go through babel and stuff to remain ok on all browsers.

So what I did is put the universalParallax var in window (in your lib).

And on my side, importing it normally like I would but call new window.universalParallax().init... and it does the trick for my kind of use case with minor change and without breaking anything for others.

I can try to push that when I get some time to test it out of my scope if you don't.

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

No branches or pull requests

2 participants