Hacker News new | ask | show | jobs
by monic 1880 days ago
What kind of deep integration are you looking for with a preferred state framework?
1 comments

If I closed my eyes and designed the API first, it would look like the `/pages` convention – just add state "slice" files in `/store` (like `src/store/user.ts`) and then use either React hooks inside the component (like `useStore` or `useMutation`) or use something (like `getServerSideState`) on the server.

Your state "slices" would export initial state, types (optionally), and an object containing getters, setters, and mutations (using Vuex concepts).