MCPcopy Index your code
hub / github.com/microsoft/SandDance / parseStream

Function parseStream

docs/app/js/sanddance-app.js:146597–146614  ·  view source on GitHub ↗

* Parse an event stream specification.

(spec)

Source from the content-addressed store, hash-verified

146595/**
146596 * Parse an event stream specification.
146597 */ function parseStream(spec) {
146598 var ctx = this, filter = spec.filter != null ? ctx.eventExpression(spec.filter) : undefined, stream = spec.stream != null ? ctx.get(spec.stream) : undefined, args;
146599 if (spec.source) stream = ctx.events(spec.source, spec.type, filter);
146600 else if (spec.merge) {
146601 args = spec.merge.map((_)=>ctx.get(_));
146602 stream = args[0].merge.apply(args[0], args.slice(1));
146603 }
146604 if (spec.between) {
146605 args = spec.between.map((_)=>ctx.get(_));
146606 stream = stream.between(args[0], args[1]);
146607 }
146608 if (spec.filter) stream = stream.filter(filter);
146609 if (spec.throttle != null) stream = stream.throttle(+spec.throttle);
146610 if (spec.debounce != null) stream = stream.debounce(+spec.debounce);
146611 if (stream == null) (0, _vegaUtil.error)("Invalid stream definition: " + JSON.stringify(spec));
146612 if (spec.consume) stream.consume(true);
146613 ctx.stream(spec, stream);
146614}
146615/**
146616 * Parse an event-driven operator update.
146617 */ function parseUpdate(spec) {

Callers 5

mergeStreamFunction · 0.70
nestedStreamFunction · 0.70
streamParametersFunction · 0.70
streamSourceFunction · 0.70
parseSelectorFunction · 0.70

Calls 6

methodFunction · 0.70
parseThrottleFunction · 0.70
findFunction · 0.70
isMarkTypeFunction · 0.70
getMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected