MCPcopy
hub / github.com/rollup/rollup / handleEvent

Function handleEvent

test/watch/index.js:120–135  ·  view source on GitHub ↗
(...parameters)

Source from the content-addressed store, hash-verified

118 await new Promise((resolve, reject) => {
119 let currentEvent = null;
120 const handleEvent = async (...parameters) => {
121 events.add(parameters[0]?.code);
122 if (currentEvent) {
123 watcher.close();
124 return reject(
125 new Error(
126 `Event ${JSON.stringify(parameters)} was emitted while handling ${JSON.stringify(
127 currentEvent
128 )}.`
129 )
130 );
131 }
132 currentEvent = parameters;
133 await wait(100);
134 currentEvent = null;
135 };
136 // This should work but should not have an effect
137 watcher.off('event', handleEvent);
138 watcher.on('event', handleEvent);

Callers

nothing calls this directly

Calls 3

rejectFunction · 0.85
addMethod · 0.80
closeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…