Closed phildaniels closed 1 year ago
I opened a pr for this here
Thanks - yes this is indeed a good and required addition. Thanks for making the PR!
Placed in the preview. Thanks for the awesome contribution @phildaniels !
Thanks for accepting this, we use piral everywhere at my org so this will let me implement best practices on fetch much easier
Sure if you have any other ideas for improvements just let us know!
New Feature Proposal
Add abort signal to piral-fetch fetch options
Description
In the piral-fetch, the fetch function accepts various options, but no abort signal that can be passed per request
Background
It is generally good practice to be able to pass an abort signal to a fetch call so the call can be cancelled for whatever reason (react component unmount, cancelling a download, etc.). There is no easy way to do this with piral-fetch today as a pilet author.
Discussion
createFetchApi would be able to pass one signal for every request by every Pilet consuming the fetch api as a default, but it would be difficult to share this controller among the different pilets. I think just adding the option would be nice as an optional parameter