Ionic Framework v6 VueJS And Firebase - Authentication Flow Using Pinia For State Management
Updated: Jan 1, 2022
Please contact us at email@example.com for a 30-minute free consult to see how we can help you tech enable your business.
When working with an application, website, or mobile app at a certain point it becomes too complex to manage all of the information about your app by passing around properties or storing the information in the database just to use it again on the next page.
Too often integrating a state manager to manage that complexity for you seems out of reach, When taking a quick look at Vuex, I can see why; often there is confusion around when to use a mutation or an action? What is a commit? where did my payload go? What do I need to dispatch?
This and many other related issues or concerns are addressed with this new state manager for VueJS called Pinia
Pinia started as an experiment to redesign what a Store for Vue could look like with the Composition API around November 2019. Since then, the initial principles are still the same, but Pinia works for both Vue 2 and Vue 3 and doesn't require you to use the composition API.
The Video Covers
We are also using the newest version of Firebase in this template, the APIs have changed a bit but the examples in the application try to make it easier
How to manage the authentication flow with state management in Pinia
Keep the user state and profile information there.
Manage authentication guards in the vuejs router utilizing state variables.
Updating data in your application views as the data is refreshed in firebase. Using collection listeners and updating the Pinia State.
We are an Ionic Framework Trusted Partner, contact us at firstname.lastname@example.org for a free consultation regarding your web and mobile development needs.