MCPcopy
hub / github.com/kefirjs/kefir / duplicate

Function duplicate

test/specs/with-handler.js:17–31  ·  view source on GitHub ↗
(emitter, event)

Source from the content-addressed store, hash-verified

15 const emitEventMirror = (emitter, event) => emitter.emitEvent(event)
16
17 const duplicate = (emitter, event) => {
18 if (event.type === 'value') {
19 emitter.emit(event.value)
20 if (!event.current) {
21 return emitter.emit(event.value)
22 }
23 } else if (event.type === 'error') {
24 emitter.error(event.value)
25 if (!event.current) {
26 return emitter.error(event.value)
27 }
28 } else {
29 return emitter.end()
30 }
31 }
32
33 describe('stream', () => {
34 it('should return stream', () => {

Callers

nothing calls this directly

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…