UNPKG

react-router-ga

Version:

[![Downloads](https://img.shields.io/npm/dm/react-router-ga)](https://npm.im/react-router-ga) [![Version](https://img.shields.io/npm/v/react-router-ga)](https://npm.im/react-router-ga) [![License](https://img.shields.io/npm/l/react-router-ga)](https://ope

25 lines (17 loc) 456 B
'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;