Ractive.js tutorial - The final touch (6 of 6)
(Previous step: Managing user's notes)
There are some little things we should improve in our application:
Home flickering
Right now, if you reload the page with a user page URL in the browser, you first see the home page and then you're redirected to the user page. When we load the application and the router (PageJS) gets initialized, it checks the URL and invokes the corresponding route handler (you can disable this behaviour if you want to by using the dispatch attribute). As we have configured the default view to be 'HomePage' in our App instance, it will get loaded before the router does its magic.
My solution for this is to create an empty view in our App and set it to be the default view, so we won't see any sub-view until the router invokes the right route handler and the right view is promoted to be shown.