MCPcopy
hub / github.com/remy/jsconsole / add

Method add

lib/es.js:12–21  ·  view source on GitHub ↗
(id, res, xhr = false)

Source from the content-addressed store, hash-verified

10 }
11
12 add(id, res, xhr = false) {
13 console.log('adding and sending to %s', id);
14 res.writeHead(200, {
15 'Content-Type': 'text/event-stream',
16 'Cache-Control': 'no-cache',
17 });
18 res.write(`eventId: 0\n\n`);
19 this.sessions[id] = res;
20 this.sessions[id].xhr = xhr;
21 }
22
23 locals(id) {
24 return (this.sessions[id] || { locals: null }).locals;

Callers 2

app.jsFile · 0.80
enumerateFunction · 0.80

Calls 1

logMethod · 0.80

Tested by

no test coverage detected