I'm submitting a feature request
Current behavior:
cancel method exists only on the promise returned by send method. If then is called on this promise, the returned promise doesn't have cancel method.
@autoinject
export class BackendRepository {
constructor(private httpClient: HttpClient) {}
getItems(): Promise<Item[]> {
return this.httpClient.createRequest("/items").asGet().send()
.then((responseData: any) => responseData.data);
}
}
In this example, HTTP response needs to be unwrapped from a response envelope to return proper types to TS app. But it can't be cancelled in upper layers of the TS app, where the request was triggered.
Expected/desired behavior:
-
What is the expected behavior?
The promise returned by then should have cancel method.
-
What is the motivation / use case for changing the behavior?
To allow cancelling promises after callbacks are applied.
I'm submitting a feature request
1.2.1
Current behavior:
cancelmethod exists only on the promise returned bysendmethod. Ifthenis called on this promise, the returned promise doesn't havecancelmethod.In this example, HTTP response needs to be unwrapped from a response envelope to return proper types to TS app. But it can't be cancelled in upper layers of the TS app, where the request was triggered.
Expected/desired behavior:
What is the expected behavior?
The promise returned by
thenshould havecancelmethod.What is the motivation / use case for changing the behavior?
To allow cancelling promises after callbacks are applied.