Closed fffx closed 4 years ago
I am not sure about unbinding the event, idea is to possibly toggle render_async
as many times as you want. For example, maybe users want to do something like this:
<a href='#' id='reload-comments'>Reload</a>
<%= render_async comments_path, toggle: { selector: '#reload-comments', event: :click } %>
But, we can add a possibility to unbind the event if it's a problem for some folks. Leave 👍 if you'd like to see this in render_async
For example, maybe users want to do something like this
I want it. I'd love to render some widget by additional request and rerender it when some event happened. For now I can achive this only by hack with container_id
(I render wrapper with that id on renderred partial).
This is solved in https://github.com/renderedtext/render_async/pull/96 and released in 2.1.4 version https://github.com/renderedtext/render_async/releases/tag/2.1.4
Shouldn't we unbind the Event after partial fetched? I notice that the event still triggered and fetch the partial every time after the partial already be rendered.
In jquery we can achieve this by use namespace event, and in pure js we can use removeEventListener
I would like make PR if this is a bug?