source: trip-planner-front/node_modules/sockjs-client/lib/transport/sender/xhr-fake.js@ bdd6491

Last change on this file since bdd6491 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 456 bytes
Line 
1'use strict';
2
3var EventEmitter = require('events').EventEmitter
4 , inherits = require('inherits')
5 ;
6
7function XHRFake(/* method, url, payload, opts */) {
8 var self = this;
9 EventEmitter.call(this);
10
11 this.to = setTimeout(function() {
12 self.emit('finish', 200, '{}');
13 }, XHRFake.timeout);
14}
15
16inherits(XHRFake, EventEmitter);
17
18XHRFake.prototype.close = function() {
19 clearTimeout(this.to);
20};
21
22XHRFake.timeout = 2000;
23
24module.exports = XHRFake;
Note: See TracBrowser for help on using the repository browser.