Zust4help Full Today

// Get current state console.log(store.getState().count) // 0

import useStore from 'zustand' import store from './vanilla-store' function Counter() const count = useStore(store, (state) => state.count) const increment = useStore(store, (state) => state.increment) return <button onClick=increment>count</button> zust4help full

// store/index.js import create from 'zustand' import createUserSlice from './slices/userSlice' import createCartSlice from './slices/cartSlice' // Get current state console