Knowledge Explorer Step 12: One Source of Truth

Replace the three separate pieces of state inside useSearch with a single reducer handling start, success and failure. Confirm by hand that starting a new search always clears a previous error, and that no sequence of clicks can produce a spinner sitting next to an error message. If the application has a theme or a saved-items feature, put that in context instead, and keep the search state exactly where it is: it is not application-wide and it does not belong there.

SANKOFA SANDBOX
loading editor…
Your turn → Work through it step by step. This is a piece of the course project, not a throwaway exercise.

Built it in both languages?

Mark it done once your Python and JavaScript versions both run correctly. Honesty here is what makes the dashboard useful to you.

← BackNext: Module 13: Performance →