随笔分类 -  XState

摘要:Unbeknownst to many, promises are state machines. They exist in either an idle, pending, resolved or rejected state. Because they can be modeled as st 阅读全文
posted @ 2020-01-21 17:17 Zhentiw 阅读(425) 评论(0) 推荐(0) 编辑
摘要:The passing of time can be represented as an event in XState. Rather than requiring the user to send an event after an amount of time has passed, XSta 阅读全文
posted @ 2020-01-21 03:32 Zhentiw 阅读(124) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。
posted @ 2020-01-21 03:27 Zhentiw 阅读(6) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。
posted @ 2020-01-20 02:15 Zhentiw 阅读(6) 评论(0) 推荐(0) 编辑
摘要:Can you walk and talk at the same time? If so, you've experienced what it's like to be in two states at the same time. Hopefully, those two states hav 阅读全文
posted @ 2020-01-20 02:04 Zhentiw 阅读(233) 评论(0) 推荐(0) 编辑
摘要:As our state machines grow more complex, we might find ourselves in a situation where a state should only exist if the machine is already in another s 阅读全文
posted @ 2020-01-19 23:07 Zhentiw 阅读(201) 评论(0) 推荐(0) 编辑
摘要:Not all transitions should be taken immediately. Occasionally, we would like to conditionally take a transition. We do this through the use of "guards 阅读全文
posted @ 2020-01-19 22:52 Zhentiw 阅读(180) 评论(0) 推荐(0) 编辑
摘要:Activities are continuous, ongoing side effects that are triggered by entering a particular state, and only stop when that state is exited. In the exa 阅读全文
posted @ 2020-01-19 22:35 Zhentiw 阅读(138) 评论(0) 推荐(0) 编辑
摘要:Consider a text input. It would be impossible for anyone to model every value you could possibly put into it, because the number of possible values is 阅读全文
posted @ 2020-01-19 22:19 Zhentiw 阅读(164) 评论(0) 推荐(0) 编辑
摘要:XState provides the send function to create an action that will send the event passed in to the machine. If we provide the second argument to the send 阅读全文
posted @ 2020-01-19 20:21 Zhentiw 阅读(312) 评论(0) 推荐(0) 编辑
摘要:Transitions come in two varieties: "external" and "internal". By default, a transition is considered external. This means that a transition will exit  阅读全文
posted @ 2020-01-19 20:11 Zhentiw 阅读(275) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。
posted @ 2020-01-19 03:04 Zhentiw 阅读(4) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。
posted @ 2020-01-19 02:53 Zhentiw 阅读(9) 评论(0) 推荐(0) 编辑
摘要:While it's powerful enough to have Machine.transition, it can get tedious constantly passing it a state and an event. It would be nice if we had a fun 阅读全文
posted @ 2020-01-18 22:45 Zhentiw 阅读(154) 评论(0) 推荐(0) 编辑
摘要:numerating the possible states of a function is a sound way to write a function, but it is imperative and could benefit from abstraction. We can do th 阅读全文
posted @ 2020-01-18 17:35 Zhentiw 阅读(158) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示