Exposing the $magic method externally is like the store() function. #3894
Closed
goSeeFuture
started this conversation in
3. Feature Ideas
Replies: 1 comment 1 reply
-
This won't make a ton of sense. Since virtually all of the core magics (And many others) are element bound. What these should do instead, like some of the core plugins do, is add a way to call it on the Alpine (or other accessible means). With that in mind, this becomes more of a Plugin dev issue, as all the Alpine provided magics are element bound or available on |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Sometimes we need to access the $magic function directly in JavaScript, for example, when using the alpinejs-notifications plugin, a common scenario is to give a notification after a successful click on the submit form, then we need to call the notification function directly in JavaScript, but I looked up the
alpinejs
docs and the source code, and eventually I found that themagics
object isn't exposed to the public, so maybe we can use it like thestore()
function.This allows us to use notifications in this way
Beta Was this translation helpful? Give feedback.
All reactions