Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

状态更新是在状态机的action里执行还是根据返回nextStatus在外部更新? #382

Open
CrazyMelody opened this issue Dec 20, 2022 · 2 comments

Comments

@CrazyMelody
Copy link

根据状态机的定义,是在执行action后返回nextStatus,那么订单状态从待付款更新为已付款的时候,除了状态更新,还会有付款时间等其他字段更新,那么有两种情况:

1.订单的状态字段,付款时间等信息是在action里面直接更新。
2.通过fireEvent,执行action,在action里更新付款时间,返回nextStatus后,在状态机外部再update状态。

如果是1,那么返回的nextStatus好像也没什么太大用处?
如果是2,更新逻辑又分散开感觉又不太合理。

@aitxiaogang
Copy link

同问,我也有此疑惑

@rigger-chen
Copy link

同感

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants