Typed Explorer Step 6: The Four States, Enforced

Replace your Explorer's separate loading, error and items state with one discriminated union. Then work through every component that reads it and let the compiler tell you where you were assuming a field that might not be there. Add an exhaustiveness check in whichever component renders the states. Finally, add a fifth state, anything you like, and count how many compile errors appear: that number is how many places you would have had to find by hand.

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 7: Generics →