andyrichardson / andyrichardson/tipple

Add "new Suspense" support

Đang mở
#55 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Feature
Ngôn ngữ chính
TypeScript
Star
129
Fork
5
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

https://reactjs.org/docs/concurrent-mode-suspense.html

## Update 1
Quick update on my thoughts surrounding this so far.

While there isn't a huge amount of work to support concurrent-react, there are [pattern changes](https://reactjs.org/docs/concurrent-mode-suspense.html#for-library-authors) that will need to be considered.

I haven't used these patterns in person yet so I will save my scepticism until having tried it out. The following API changes would need to be made:
- useFetch / usePush would need to stay the same (breaking changes would occur otherwise)
- usePreloadedFetch / usePreloadedPush would be completely separate implementations which are responsible for reading from the client and throwing / resolving results
- preloadFetch / preloadPush would be responsible for triggering API calls

This has two major impacts on Tipple:
- For suspense support, fetching + reading state are two separate interactions (as opposed to useXYZ which does both)
- As fetching in Tipple is currently coupled to the hooks/calling components, changes would need to be made to the client + overall implementation

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.