Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
capture
function to preserve type identity (#4)
* Add a test that demonstrates the issue with `capture` function The `capture` function should pass-through any type it is given, in fact, it should act as an identity-function from the type perspective. * The `capture` function passes through the type correctly. It should act as an identity function from type perspective. The use-case is that CancellablePromise might be enhanced with some additional information, such as progress reporting. We need the enhancements to be preserved when the promise is passed through the `capture` function. Before the fix, the return type from `capture` would be a bare CancellablePromise<T>, hiding any additional features of the particular type that inherited from CancellablePromise<T>. * Remove nested block to make linter hapy The nested block was there for documentation purposes. * Fix test issue "Exceeded timeout of 5000 ms for a test." * Run Prettier Co-authored-by: Ondrej Stanek <ondrej@ostan.cz> Co-authored-by: Sam Magura <srmagura@gmail.com>
- Loading branch information