You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OnViewChecked and OnChildrenChecked sound good to me.
I like the idea of letting the parent know if the stuff under changed, but I don't think that providing a number of changes is useful. It should be sufficient to know if anything changed at all, so I'd go with a boolean.
on (onInit, onDestroy, onChanges) Something has just happen letting you know, I don't care what you do with it.
doCheck - I need you to do something right now.
afterViewChanges - just letting you know that we have passed a certain point. Here on would sound ambiguous, and after makes it clear that it is after view changes have been processed.
But there is still time to rename them. :-) You have other ideas?
@mhevery from your desciption above I don't get the difference of on vs after - and the doc says: OnInit (after the first check only). So really I think there should be on after everywhere:
OnInit -> AfterInit,
OnDestroy -> AfterDestroy,
OnChanges -> AfterChanges
IMO doCheck is confusing for an event name. When I see lifecycle: [LifecycleEvent.DoCheck], I'm under the impression that it is a request for checking something (that would not be checked otherwise). FWIT I can't remember ever having seen an event prefixed with do (vs on, before or after). I would be satisfied with afterCheck.
The enums members are actually interface names and those interface all define a function with the same name (in lowerCase).
May be then "Event" as in LifecycleEvent is not the most appropriate. LifecycleInterface would be more accurate but I tend to think that LifecycleMethod would be better (especially in ES5 context).
Also as we fall back to structural type checking in TS/JS and the method names are probably too generic and might lead to collision. Some proposal:
Activity
mhevery commentedon Aug 27, 2015
/cc @vsavkin @IgorMinar @vicb
IgorMinar commentedon Aug 27, 2015
OnViewCheckedandOnChildrenCheckedsound good to me.I like the idea of letting the parent know if the stuff under changed, but I don't think that providing a number of changes is useful. It should be sufficient to know if anything changed at all, so I'd go with a boolean.
chore(LifecycleEvent): change to PascalCase / rename
vicb commentedon Aug 28, 2015
After having seen your PR I get what the names actually mean.
I'm not sure I like that
on,doandafterall 3 mean after, why different prefixes ?I also find
contentconfusing (remind me of<content>)mhevery commentedon Aug 28, 2015
@vicb
on(onInit,onDestroy,onChanges) Something has just happen letting you know, I don't care what you do with it.doCheck- I need you to do something right now.afterViewChanges- just letting you know that we have passed a certain point. Hereonwould sound ambiguous, andaftermakes it clear that it is after view changes have been processed.But there is still time to rename them. :-) You have other ideas?
vicb commentedon Aug 28, 2015
@mhevery from your desciption above I don't get the difference of
onvsafter- and the doc says:OnInit(after the first check only). So really I think there should be onaftereverywhere:OnInit->AfterInit,OnDestroy->AfterDestroy,OnChanges->AfterChangesIMO
doCheckis confusing for an event name. When I seelifecycle: [LifecycleEvent.DoCheck], I'm under the impression that it is a request for checking something (that would not be checked otherwise). FWIT I can't remember ever having seen an event prefixed withdo(vs on, before or after). I would be satisfied withafterCheck.I would also use
Childreninstead ofContent.vicb commentedon Aug 28, 2015
I can see where the confusion comes from. Allow me some time to come with a better proposal.
mhevery commentedon Aug 31, 2015
So the
Content/Viewis more descriptive overChildren. Which children? View or content?.Any more thoughts?
vicb commentedon Aug 31, 2015
Yep some more thoughts:
The enums members are actually interface names and those interface all define a function with the same name (in lowerCase).
May be then "
Event" as inLifecycleEventis not the most appropriate.LifecycleInterfacewould be more accurate but I tend to think thatLifecycleMethodwould be better (especially in ES5 context).Also as we fall back to structural type checking in TS/JS and the method names are probably too generic and might lead to collision. Some proposal:
Misc notes:
mhevery commentedon Aug 31, 2015
@vicb
vicb commentedon Sep 2, 2015
closing.
angular-automatic-lock-bot commentedon Sep 7, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.