import cache from 'vue-cache'
Vue.use(cache, {baseUrl: 'Your main route', validateUrl: 'Your token validation route if any else just pass and empty string', authUrl: 'Your authentication route if any else just pass and empty string', authHeaders: ['authentication headers for the api token csrf and jwt, etc ... if any', 'epiry date etc ...'] // else don't pass anything, logoutUrl: 'Your logout url if any' })
this.$data.login(YourAuthParams).then(() => {// do whatever})
this.$data.logout().then(() => {// do whatever})
this.$data.fetchList('path to the api', 'what do you want to name that list', ['any sub routes']).then(val => {})
this.$data.ensureType('path to that entry', id).then(val => {})
this.$data.addData('path to that entry', 'name of the list', data).then(() => {}) this.$data.updateData('path to that entry', 'name of the list', id, data).then(() => {}) this.$data.deleteData('path to that entry', 'name of the list', id).then(() => {})
this.$data.isAuthenticated() // returns a boolean
this.$data.setActiveType('Your list type/name')
this.$data.loadMore().then(val => {})