Formal Status

Loading "Formal Status"
πŸ‘¨β€πŸ’Ό Let's clean up things a little bit with what we've built so far by making the status of our promise a little more formal.
What we have now is:
  • if there's an error, throw it
  • if there's no ship, throw the promise
  • render the ship
But that's not exactly clear.
So instead, let's add a status variable that can be 'pending' | 'fulfilled' | 'rejected' (start it out with 'pending').
πŸ“œ To learn more about why this is important, read Make Impossible States Impossible and Stop using isLoading booleans

Access Denied

You must login or register for the workshop to view and run the tests.

Check out this video to see how the test tab works.