Vue.js 3 Options API Masterclass
Plans from $25/month

This lesson is for members. Join us?

Subscribe now and get immediate access to this course, 30 more and all future Vue.js courses!

Unsubscribing from the Auth User Snapshot

🚧 PLEASE NOTE: This masterclass is built with the Options API
vuejs-masterclass

The Composition API Masterclass is coming soon!

In this lesson, we tidy up the authenticated user functionality by subscribing to it's snapshot for the entirety of the logged in session and only cleaning up the snapshot after the authentication state has changed. This can be accomplished by providing a callback function to the fetchItems action that is customized for the fetchAuthUser action.