Closed r0skar closed 4 years ago
The challenge for me is that I have to make a trade-off between package size and API richness. We will deviation from purpose if it is too large, it will be useless if lack of important APIs, either.
So, I've thinking of extracting destroy
events-hub and life hooks (both of them are not completed) to components, just use them whenever you need. Otherwise, It will grow larger than 3kB someday and more.
@r0skar How do you think?
A destroy method is critical for memory leaks, we need a way to be able to remove all event listeners and cleanup after the component is no longer needed. Especially in SPA applications.
@northkode You are right, I'll move destroy
to core API.
Pull Request https://github.com/joe223/tiny-swiper/pull/5
It's almost 3KB. 😂 a little bit embarrassing
Resolved at https://github.com/joe223/tiny-swiper/pull/6
Is your feature request related to a problem? Please describe. Using the swiper in a SPA, the Swiper instances are never destroyed as there are no real page-reloads.
Describe the solution you'd like Implement the
destroy
method from SwiperJS.Additional context See https://swiperjs.com/api/ for more details on the
destroy
API.