ねむにこ
Fetch APIを途中で中断したいときってGoのContextみたいなことしないといけないのか……せっかくPromiseで待ちを抽象化してるのに漏れてるじゃん
@collappsar Thanks, but that's exactly what I mean. I'm not satisfied with this design because fetch API call is often wrapped in a utility function that just returns a Promise, which makes it quite tricky to deal with the signal param
定期的にポーリングしつつ、サーバがあまりにも長い時間返事を寄越さなかったら諦めて次のループを始める的なことをしたい
Promise.race的なので待ちを諦めるのはできるけど、コネクションが残るのはちょっと気持ち悪さがある
サーバーが自主的にタイムアウトしないならリトライしても無理だからおとなしく待ってろという立場はあり得る
@collappsar Hmm yeah, it could be an option. However such object is hard to type in TypeScript without using `any`...
@collappsar oooh, I thought Object.assign would work only on object literals! This approach definitely works. Thank you for the help!!
@collappsar I love TypeScript too :) I recentely started writing a webapp after a few years of blank, and I'm surprised seeing how comprehensively React & Redux are typed. It's the best web development experience ever.