This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat($resource): add support for timeout in cancellable actions
Old behavior: actions can be either cancellable or have a numeric timeout. When having both defined, cancellable was ignored. With this commit: it's possible for actions to have both cancellable:true and numeric timeout defined. Example usage: ```js var Post = $resource('/posts/:id', {id: '@id'}, { get: { method: 'GET', cancellable: true, timeout: 10000 } }); var currentPost = Post.get({id: 1}); ... // the next request can cancel the previous one currentPost.$cancelRequest(); currentPost = Post.get({id: 2}); // any of those requests will also timeout, if the response // doesn't come within 10 seconds ``` Closes #13824
- Loading branch information
Showing
2 changed files
with
52 additions
and
21 deletions.
There are no files selected for viewing
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
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