MCPcopy Create free account
hub / github.com/UI5/webcomponents / cleanup

Function cleanup

packages/main/test/pages/diffable-html.js:6665–6685  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6663
6664 var cleanedUp = false;
6665 function cleanup() {
6666 debug('cleanup');
6667 // cleanup event handlers once the pipe is broken
6668 dest.removeListener('close', onclose);
6669 dest.removeListener('finish', onfinish);
6670 dest.removeListener('drain', ondrain);
6671 dest.removeListener('error', onerror);
6672 dest.removeListener('unpipe', onunpipe);
6673 src.removeListener('end', onend);
6674 src.removeListener('end', unpipe);
6675 src.removeListener('data', ondata);
6676
6677 cleanedUp = true;
6678
6679 // if the reader is waiting for a drain event from this
6680 // specific writer, then it would cause it to never start
6681 // flowing again.
6682 // So, if this is awaiting a drain, then we just call it now.
6683 // If we don't know, then assume that we are waiting for one.
6684 if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
6685 }
6686
6687 // If the user pushes more data while we're writing to dest then we'll end up
6688 // in ondata again. However, we only want to increase awaitDrain once because

Callers 4

onunpipeFunction · 0.70
onerrorFunction · 0.70
createReactComponentFunction · 0.50
createReactComponentFunction · 0.50

Calls 1

ondrainFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…