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

Calling $ajax from code outside of Alpine.js #54

Closed
jonnitto opened this issue Feb 8, 2024 · 5 comments
Closed

Calling $ajax from code outside of Alpine.js #54

jonnitto opened this issue Feb 8, 2024 · 5 comments

Comments

@jonnitto
Copy link

jonnitto commented Feb 8, 2024

Currently it is not possible to call the $ajax functions outside of Alpine.js

Would it technically be possible to have exported theese functions so that they will be usable outside of Alpine.js?

@imacrayon
Copy link
Owner

Yeah it’s technically possible with some refactoring…The API would have to change a little bit to fill in the missing context that Alpine provides.
My fear is if I expose that function there could be a lot of breakage between releases. The internals of this plugin are changing a lot, while I’m still figure out how things should work, and exposing them would mean more things that I have to track and document.

@jonnitto
Copy link
Author

jonnitto commented Feb 8, 2024

I solved this now by fire a custom event, and an alpine component is reacting to this… 😆

@jonnitto
Copy link
Author

jonnitto commented Feb 8, 2024

And, btw: Great plugin with a very nice website!

@imacrayon
Copy link
Owner

I solved this now by fire a custom event, and an alpine component is reacting to this… 😆

Nice! Events FTW

@imacrayon
Copy link
Owner

I'm going to close this out since the immediate issue is solve, however I'll still consider generalizing some of the internals. I could see that happening as we get closer to a v1 release.

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

2 participants