dalgard / meteor-viewmodel

Minimalist VM for Meteor
24 stars 2 forks source link

Bugfix for rare 'race condition' #21

Open KoenLav opened 8 years ago

KoenLav commented 8 years ago

Addresses #20

KoenLav commented 8 years ago

I think this is more technically correct (setting viewModelReady to false when the Nexus is first constructed (and all 'on' listeners still need to be added) and setting it to true as soon as the onReady fires.

KoenLav commented 8 years ago

I think what would actually be best is that if one of the unbinds runs before the bind rather than unbinding it removes the function from onViewReady (but I'm not sure whether this is possible).

Or rather: it might actually be a bug in Meteor, if the view is Invalidated (or Destroyed) it should never fire the onViewReady handlers, in my opinion (because quite frankly the view never became ready).

What do you think?