Relative Content

Tag Archive for next.jszustand

Initing a zustand store with outside data

I’m using a Zustand store to manage state. 
I want to fill my store with data from an API; currently, my store has an init() function that does the data fetching and setting. However, this is a bit messy. The store is created with all empty values; init() is called from a component, and then the store is useable.

Initing a zustand store with outside data

I’m using a Zustand store to manage state. 
I want to fill my store with data from an API; currently, my store has an init() function that does the data fetching and setting. However, this is a bit messy. The store is created with all empty values; init() is called from a component, and then the store is useable.

zustand store how it works with multiple session

Please bear with me 🙂 I am working on a small nextjs hobby app and wanted to test zustand library with it. I managed to use next-auth with firestore adapter and I have a session created and also can access in my client page using getSession.