# 新冠追踪器
¥Covid Tracker
这些 XState v4 文档不再维护
XState v5 现已推出!阅读有关 XState v5 的更多信息 (opens new window) 和 查看 XState v5 文档 (opens new window)。
¥XState v5 is out now! Read more about XState v5 (opens new window) and check out the XState v5 docs (opens new window).
此示例显示了使用 XState 和 React 过滤的国家/地区有关 COVID-19 大流行的当前统计数据。它包含了:
¥This example shows a current statistics about COVID-19 pandemic filtered by countries using XState and React. It contains:
covidMachine
- 处理国家/地区选择,包括负责获取全球所有国家/地区列表的 "sub-state"¥
covidMachine
- handles country selection, including a "sub-state" responsible for fetching the list of all countries across the globecovidDataMachine
- 根据所选国家/地区处理获取特定统计数据(包括confirmed
、deaths
、recovered
案例)¥
covidDataMachine
- handles fetching specific statistics (includingconfirmed
,deaths
,recovered
cases) based on selected country
负责渲染数据的两个子组件 <Indicator />
和 <Chart />
,使用来自 MachineProvider
上下文提供者的服务
¥The two child components <Indicator />
and <Chart />
that responsibles of rendering data, consumes the service from the MachineProvider
context provider
← 计算器