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

Conditionally export as a module #54

Closed
wants to merge 2 commits into from
Closed

Conversation

rylnd
Copy link

@rylnd rylnd commented Sep 6, 2017

As mentioned in #53. There's a lot that could be done to make this better (e.g. auto-invocation unless you import a named part of the module, removing the dependence on jQuery, etc.), but I promised @vjt a PR so here's the next step!

If we're in node, we export the function as a module. If not, we simply
invoke the function with jQuery (in the current scope).
@rylnd
Copy link
Author

rylnd commented Sep 6, 2017

@vjt FYI I did not have an opportunity to test this in the browser so I can't verify that it's working as expected there. FWIW this did not end up serving my purposes because it relies on jquery-ujs and we're using plain old rails-ujs instead.

@vjt
Copy link
Contributor

vjt commented Oct 5, 2017

This looks very good, thanks. I am sorry for the delay in providing an update.

As reported by @CyberDeck, this code works with rails-ujs with the changes in #55.

@vjt
Copy link
Contributor

vjt commented Oct 14, 2017

Thanks for your help. I have reworked these changes and included them in #58.

@vjt vjt closed this Oct 14, 2017
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

Successfully merging this pull request may close these issues.

2 participants