flarum / issue-archive

0 stars 0 forks source link

Abort Pending Requests on Route Change #102

Open askvortsov1 opened 3 years ago

askvortsov1 commented 3 years ago

Feature Request

Is your feature request related to a problem? Please describe. Generally speaking, route changes imply that requests initialized from the previous route are now invalid, and should be aborted.

It might make sense to automatically do this. On the other hand, many issues can be fixed more directly, which is also a bit cleaner. See https://github.com/flarum/core/pull/2319 for a proposed implementation.

davwheat commented 3 years ago

Part of me wonders how much effort we could save by just using browser fetch for API requests and an AbortController to cancel requests.

fetch has great support on browsers (at least iOS 10.3+, which should be considered good enough as mdarea uses event properties not supported in iOS 9 it seems).

askvortsov1 commented 3 years ago

I don't see a strong reason for switching from Mithril's m.request tbh.