Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.2k views
in Technique[技术] by (71.8m points)

一段资源请求的逻辑,最佳实践要怎么写?

react项目

有1 2 3 4四个资源都需要异步加载

2 依赖 1的结果 => 处理成a

3 ,4 依赖 a

每一步都可以展示部分内容, 直接用promise.all 感觉不对

这段逻辑要怎么处理

能不能处理的更细节,只要上级依赖存在就可以执行当前步骤的渲染, 类似渐进渲染,rx 是不是可以处理这种场景


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

promise.all肯定是可以的,yield也行


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...