feat(createResources): abort method to cancel ongoing fetch requests#494
feat(createResources): abort method to cancel ongoing fetch requests#494
Conversation
|
The dev has to write these unmount wrappers manually? 👀 Can we do a plugin (or hook) or something which automatically aborts? I think it should be possible at least for route changes. |
hm so the user can just use this wrapper of createResource import { abortableFetch } from "frappe-ui"
const posts = abortableFetch( { url } ) |
|
That could work too. But since createResource is also a hook, maybe a config like "abortOnUnmount"? |
|
|
Closes: #26
Usage
Screen.Recording.2025-12-04.at.12.00.34.PM.mov
To those who want to do this automatically , just make a wrapper over createResources()