javascript - Promise - is it possible to force cancel a promise -
i use es6 promises manage of network data retrieval , there situations need force cancel them. basically scenario such have type-ahead search on ui request delegated backend has carry out search based on partial input. while network request (#1) may take little bit of time, user continues type triggers backend call (#2) here #2 naturally takes precedence on #1 cancel promise wrapping request #1. have cache of promises in data layer can theoretically retrieve attempting submit promise #2. but how cancel promise #1 once retrieve cache? could suggest approach? no. can't yet. es6 promises not support cancellation yet . it's on way, , design lot of people worked hard on. sound cancellation semantics hard right , work in progress. there interesting debates on "fetch" repo, on esdiscuss , on several other repos on gh i'd patient if you. but, but, but.. cancellation important! it is, reality of matter cancellation really important scenario in...