pmndrs / suspend-react

🚥 Async/await for React components
MIT License
1.37k stars 25 forks source link

🏷️ use awaited #23

Open ryuji-1to opened 1 year ago

ryuji-1to commented 1 year ago

I have made changes to utilize the built-in Awaited type for handling asynchronous operations.

drcmda commented 1 year ago

wait, typescript can finally do this now? since when?

joshuaellis commented 1 year ago

For a while now

drcmda commented 1 year ago

is it propagated enough? safe to merge?

ryuji-1to commented 1 year ago

I apologize for any confusion caused. Since your project is using TypeScript 4.4.4, it is likely that you cannot directly use the Awaited type introduced in TypeScript 4.5. https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html

joshuaellis commented 1 year ago

is it propagated enough? safe to merge?

Depends what version of TS you want to support – I think if we upgrade the TS version then it's not outrageous to do.