First commit
This commit is contained in:
24
hGameTest/node_modules/sockjs-client/lib/transport/sender/xhr-fake.js
generated
vendored
Normal file
24
hGameTest/node_modules/sockjs-client/lib/transport/sender/xhr-fake.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
'use strict';
|
||||
|
||||
var EventEmitter = require('events').EventEmitter
|
||||
, inherits = require('inherits')
|
||||
;
|
||||
|
||||
function XHRFake(/* method, url, payload, opts */) {
|
||||
var self = this;
|
||||
EventEmitter.call(this);
|
||||
|
||||
this.to = setTimeout(function() {
|
||||
self.emit('finish', 200, '{}');
|
||||
}, XHRFake.timeout);
|
||||
}
|
||||
|
||||
inherits(XHRFake, EventEmitter);
|
||||
|
||||
XHRFake.prototype.close = function() {
|
||||
clearTimeout(this.to);
|
||||
};
|
||||
|
||||
XHRFake.timeout = 2000;
|
||||
|
||||
module.exports = XHRFake;
|
||||
Reference in New Issue
Block a user