Complete Vue.js 2 Web Development_ Practical guide to building end-to-end web development solutions with Vue.js 2

(singke) #1
Caching the Current Folder Structure Using Vuex Chapter 6

state.path = (hash || '');
},
structure(state, payload) {
state.structure[payload.path] = payload.data;
}
}
});
const app = new Vue({
el: '#app',

store,
created() {
store.commit('updateHash');
}
});
window.onhashchange = () => {
app.$store.commit('updateHash');
}

Summary


After this chapter, your app should now be integrated with Vuex and be caching the


contents of the Dropbox folders. The Dropbox folder path should also be utilizing the


store to make the app more efficient. We are also querying the API only when we need to.


In Chapter 7, Pre-Caching Other Folders and Files for Faster Navigation, we will look at


precaching the folders—actively querying the API in advance to speed up the app


navigation and usability.

Free download pdf