Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Why Template.myTemplate.rendered created destroyed fire multiple times ? #435

Closed
crapthings opened this Issue · 2 comments

2 participants

@crapthings
Template['module-following-item'].destroyed = ->
    console.log 'this will fire multiple times'

maybe the events bind multiple times too ? is this normal ?

if i have 20 Template['module-following-item'], when every single template destroyed, it will execute function 20 times.

@crapthings

Say if i have 400 docs publish to client, and every template's function and binding event fire two times, they cause 800 executes.

@glasser
Owner

That's what they're supposed to do. These callbacks are associated with a particular instance of a template on the screen, so if you display a template 400 times they each get called 400 times.

What are you trying to accomplish with these callbacks that would work better if only called once?

@glasser glasser closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.