MCPcopy Create free account
hub / github.com/deanrad/rxfx / next

Function next

operators/src/toggleMap.ts:35–47  ·  view source on GitHub ↗
(trigger)

Source from the content-addressed store, hash-verified

33
34 return source.subscribe({
35 next(trigger) {
36 if (!innerSub || innerSub.closed) {
37 innerSub = from(workCreator(trigger)).subscribe({
38 next: (inner) => {
39 const result = (mapper ? mapper(trigger, inner) : inner) as S;
40 notify.next(result);
41 },
42 error: (e) => notify.error(e),
43 });
44 } else {
45 innerSub.unsubscribe();
46 }
47 },
48 error(e) {
49 notify.error(e);
50 },

Callers

nothing calls this directly

Calls 5

mapperFunction · 0.85
subscribeMethod · 0.80
nextMethod · 0.80
errorMethod · 0.80
unsubscribeMethod · 0.80

Tested by

no test coverage detected