WIP effection retry blogpost#374
WIP effection retry blogpost#374minkimcello wants to merge 4 commits intothefrontside:productionfrom
Conversation
👷 Deploy request for frontside pending review.Visit the deploys page to approve it
|
e7d2cf2 to
e4ea906
Compare
| const response = yield* call(fetch("https://foo.bar"), { signal }); | ||
|
|
||
| if (response.ok) { | ||
| return yield* call(response.json()); |
There was a problem hiding this comment.
Let's use call(() => response.jon()) here instead of call(response.json). We're probably going to change this upstream, so just to make it forward compatible.
| } | ||
| } | ||
|
|
||
| main(function* () { |
There was a problem hiding this comment.
Let's use run in the example here because main is only for scripts.
There was a problem hiding this comment.
This one's done too
| let attempt = -1; | ||
| while (true) { | ||
| const signal = yield* useAbortSignal(); | ||
| const response = yield* call(fetch("https://foo.bar"), { signal }); |
There was a problem hiding this comment.
We should take take argument from fetchWithBackoff.
function* fetchWithBackoff(url: URL | string, init?: RequestInit) {
const signal = yield* useAbortSignal();
const response = yield* call(() => fetch(url, { ...init, signal }));
}There was a problem hiding this comment.
I added the arguments for all the examples except the last one. If we're surfacing the function to the top, those don't need to be an argument, right?
|
Looks good. Should we start working on the text now? |
👌 |
d8de1f5 to
2463ade
Compare
|
@taras I might need some help with the intro and outro. And let me know what you think of the draft. |
WIP
Motivation
Approach
Alternate Designs
Possible Drawbacks or Risks
TODOs and Open Questions
Learning
Screenshots