Due Fri 12/12 midnight, no late penalty or turnin.
https://classroom.github.com/a/AZZW7TWA
In this assignment, we will refactor our react scheduler app to use a centralized state management library. Global state management with Redux has long been considered necessary for react apps with any level of complex state. Managing state per-component gets too unwieldy otherwise.
As is always the case, as developers have settled into predictable usage patterns newer libraries have come along to streamline or otherwise improve on the ideas. We'll be using zustand, a very popular option that sells itself on being small and fast with far less boilerplate compared to Redux.
Again, make sure that your A11 is working *before* you start changing anything.
The steps below include images from the class_example that we went through together, to indicate which part of the example maps to which step in the assignment.
npm install zustand
Create store.js to hold all our state (courses, instructors, loading, error)
useStore function and import it into App.jsxAdd the initial fetch action to the store (include error handling)
Use selective subscription in App to run the fetch action and display the data

course object as a prop, we don't subscribe to it
Course will already be redrawn when the courses data changes and triggers a redraw of AppaddSection action to the store and subscribe to it from Course
In your handler, use the set function that is passed into create to do store updates
set passes the store into your callback, but if you need access to the store outside set, you
can use the getStore parameter passed to create
memo the Course component to avoid unnecessary redrawsSection component and its edit and delete actionsSection (simple pass-through component and it's parent is already memoized)