Cancellation
See original GitHub issueThe ask here is:
- suspend accepts a first parameter that is an
AbortSignal. - when the component is unmounted - abort the controller associated with the signal.
e.g.
function Post({ id, version }) {
const data = suspend(async ({ signal }) => {
const res = await fetch(`https://hacker-news.firebaseio.com/${version}/item/${id}.json`, { signal })
return await res.json()
}, [id, version])
return (
<div>
{data.title} by {data.by}
</div>
)
}
Basically allowing aborting expensive async actions.
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Cancellation Definition & Meaning - Merriam-Webster
1 · the act or an instance of canceling. The cancellation of the game was due to bad weather. ; 2 · something...
Read more >Cancellation Definition & Meaning - Dictionary.com
something canceled, as a reservation for a hotel room, airplane ticket, allowing someone else to obtain the accommodation.
Read more >cancellation - Wiktionary
NounEdit · The act, process, or result of cancelling; as, the cancellation of certain words in a contract, or of the contract itself....
Read more >CANCELLATION definition | Cambridge English Dictionary
the act of deciding that an organized event will not happen or of stopping an order for something: Many trains are subject to...
Read more >37 Synonyms & Antonyms for CANCELLATION - Thesaurus.com
Find 37 ways to say CANCELLATION, along with antonyms, related words, and example sentences at Thesaurus.com, the world's most trusted free thesaurus.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

im glad you asked, because there aren’t any. by all means … add some 😄
about the call signature, maybe:
so keys come out as they go in (as an array, no spread), second arg is an extensible object that could later be built out.