Open MartinMuzatko opened 8 years ago
I fully agree with having mixin
s on top. I personally don't mind if properties and "opts properties" are mixed as it's just a matter of initiation. In practice I think those are mostly moved to .on('update')
. And I would maybe combine lifecycle other event handlers, as they are both just event listeners. And otherwise I would prefer mount
, update
, updated
, otherEvents
, unmount
as that would basically be the chronological order.
So simplified order:
I wouldn't mind extending "put tag properties and methods on top".
I'd define more than just properties/methods.
While it is usual for angular/angular2 to have the lifecycle events at the top (constructor/ngOnInit) I'd put them at the bottom. That is to be discussed.
So I'd declare this structure as best practice / well organized:
e.g.: