MCPcopy
hub / github.com/react/create-react-app / XhrReceiver

Function XhrReceiver

packages/react-error-overlay/fixtures/bundle_u.mjs:6402–6420  ·  view source on GitHub ↗
(url, AjaxObject)

Source from the content-addressed store, hash-verified

6400}
6401
6402function XhrReceiver(url, AjaxObject) {
6403 debug(url);
6404 EventEmitter.call(this);
6405 var self = this;
6406
6407 this.bufferPosition = 0;
6408
6409 this.xo = new AjaxObject('POST', url, null);
6410 this.xo.on('chunk', this._chunkHandler.bind(this));
6411 this.xo.once('finish', function(status, text) {
6412 debug('finish', status, text);
6413 self._chunkHandler(status, text);
6414 self.xo = null;
6415 var reason = status === 200 ? 'network' : 'permanent';
6416 debug('close', reason);
6417 self.emit('close', null, reason);
6418 self._cleanup();
6419 });
6420}
6421
6422inherits(XhrReceiver, EventEmitter);
6423

Callers

nothing calls this directly

Calls 1

debugFunction · 0.70

Tested by

no test coverage detected