mrmilu / react.base

Mr Milú's official starter template for React.js projects.
5 stars 0 forks source link

Feature/7 zustand #8

Closed arnaugomez closed 1 year ago

arnaugomez commented 1 year ago

Closes #7 Simple Zustand usage example.

New page /posts-zustand, shows a list of posts.

Posts are loaded from a mock data source. Error and loading states are handled.

The data fetching logic is separated from the PostsZustandPageResults component and moved inside the usePostsController custom hook. This helps with the readability of the React component and separation of concerns.