Re:Next.js 10.2
by monic on Wednesday April 28, 2021 @12:05PM
(#26970920)
What kind of deep integration are you looking for with a preferred state framework?
[ Parent
| on HN ]
Re:Next.js 10.2
by matthoiland on Wednesday April 28, 2021 @12:45PM
(#26971416)
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).