Switch to use more state machine like state management in progressService
**Problem** In progress service, the `ProgressState` object is quite difficult to understand. Only a subset of fields are active at a given time so the state is really more like a state machine. When enabling strict null checks, the existing pattern is also a pain because it is not clear which subset of fields go to gether and will not be undefined **Fix** I've been experimenting with writing states much explicitly. This has two main points: - Encapsulating all state in a single state object (which the progress service already does) - Encoding each valid state very explicitly in a state machine like manner For progress service, the encoding breaks the `ProgressState` object up into five different states that the progress service transitions between.
Showing
想要评论请 注册 或 登录