I have 10 lines written to the system events.
Events.Add("PageSkeleton", function (data) {
if (!data) {
Page.Load('logo', '/page/incl/logoNotAuth.html');
Page.Load('footermenu', '/page/incl/footerNotAuth.html');
} else {
Page.Load('logo', '/page/incl/logo.html');
Page.Load('footermenu', '/page/incl/footer.html');
}
});
//load the start page
Events.Call("PageSkeleton", false)
Page.Load('page', '/page/index.html');
I create all the events in 1 place, and then call them anywhere in your code. Instead of intercept a click on the link (for the url) I stupidly hang onclick which cause an event, and some events cause other events, etc. the Code is expressive yet (perhaps the situation will worsen when a couple of thousand events).
What do you say?
UPD.
My auditre 80% of bricks that can't trendit spa frameworks for this have done so.