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
fetch has yet to provide a standard way of aborting a request. Therefore, there's no way to implement connection timeout. (#27) | |
fetch has failed to provide an API to set response timeout. (#20) | |
...which means that you'll have to wait until the end of the response or the occurrence of a network error. | |
...or, use setTimeout or Promise.race to manually reject the returned promise if you need a timeout. And it has a tiny side effect (#175): | |
mislav commented on 29 Jul 2015 | |
Also note that with the above implementation, even if the timeout happens, the original request won't be aborted because we don't have an API to abort fetch requests. Instead, the request will complete in the background but its response will get discarded. |
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
export class HttpClient { | |
constructor(defaults) { | |
this.defaults = defaults; | |
this.interceptors = []; | |
this.activeRequestCount = 0; | |
this.isRequesting = false; | |
} | |
addInterceptor(interceptor) { | |
this.interceptors.push(interceptor); |
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
@keyframes jelly-pop { 0% { opacity: 0; transform: matrix3d(0.1, 0, 0, 0, 0, 0.1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } | |
3.4% { opacity: 1; transform: matrix3d(0.384, 0, 0, 0, 0, 0.466, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } | |
4.7% { transform: matrix3d(0.505, 0, 0, 0, 0, 0.639, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } | |
6.81% { transform: matrix3d(0.693, 0, 0, 0, 0, 0.904, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } | |
9.41% { transform: matrix3d(0.895, 0, 0, 0, 0, 1.151, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } | |
10.21% { transform: matrix3d(0.947, 0, 0, 0, 0, 1.204, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } | |
13.61% { transform: matrix3d(1.111, 0, 0, 0, 0, 1.299, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } | |
14.11% { transform: matrix3d(1.127, 0, 0, 0, 0, 1.298, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } | |
17.52% { transform: matrix3d(1.187, 0, 0, 0, 0, 1.216, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } | |
18.72% { transform: matrix3d(1.191, 0, 0, 0, 0, 1.169, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } |
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
var jquery = require('jquery'); | |
var dummy = (function($) { | |
"use strict"; | |
var _privateMethod = function() { | |
console.log('privateMethod'); | |
}; | |
var publicMethod = function() { |
NewerOlder