
Any async operation has states: idle, loading, success, or error. Managing these states properly is crucial for good UX. Let's build a state machine!
createAsyncState() factorystatus (idle/loading/success/error), data, errorstartLoading(), setSuccess(data), setError(error), reset()getState() to return current state objectSubmit your code to see test results