Why isn't the destroy()
method documented?
#3420
Replies: 3 comments 1 reply
-
Generally, the reason things are left undocumented is so that they could be changed (in behavior, name, etc) without needing a major version release. It's possible that, for a period, Caleb had other plans for it, or may still have them, and hasn't committed to this. He has mentioned liking how But we can only really guess. But yes, the reason anything would be undocumented is normally to prevent people from writing code that depends on something that could breakingly change. You can try to make that PR and see what happens. |
Beta Was this translation helpful? Give feedback.
-
@calebporzio Any thoughts? Is this feature safe to use? |
Beta Was this translation helpful? Give feedback.
-
I might have an interesting use-case for this feature. I have combined the usage of Alpine.js and Barba.js for transitioning between pages. The issue I am facing is that once a component is initialized through the EDIT: Componets do get destroyed on page change - |
Beta Was this translation helpful? Give feedback.
-
I was doing a little bit of poking around at https://component-party.dev/, and it gave an example using Alpine.JS that uses a
destroy()
method inx-data
.I hadn't heard of this method, so I took a look around the docs, and it's not there. Then, I did a bit of searching and came upon this blog post from nearly two years ago, describing this same
destroy()
method, although it explicitly mentions that it's undocumented and it should be used with caution.So what's the story on this method? Should I use it or should I avoid it? Should it be added to the docs?
Beta Was this translation helpful? Give feedback.
All reactions