DevPath

Model loading, success and error states

Mid · fluency · 25 min · runtime php-cli

Brief

Define a discriminated union RequestState for a data request with statuses 'loading', 'success' (with data) and 'error' (with a message), such that impossible states cannot be represented.

3 progressive hints are available in the editor.

Public checks

  • has three states — expected: loading, success, error variants