This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// nb. This code is available in an ES module of Promise helpers, here: | |
// https://github.com/samthor/promises | |
// symbol returned to indicate that a call was cancelled | |
export const takeoverSymbol = Symbol('takeover'); | |
/** | |
* Accepts a generator function, which yields Promises, and converts it to an async function | |
* that cancels any previous calls. | |
*/ |