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

Function events

docs/app/js/sanddance-app.js:107811–107828  ·  view source on GitHub ↗

* Create a new event stream from an event source. * @param {object} source - The event source to monitor. The input must * support the addEventListener method. * @param {string} type - The event type. * @param {function(object): boolean} [filter] - Event filter function. * @param {function(obj

(source, type, filter4, apply)

Source from the content-addressed store, hash-verified

107809 * used as the downstream event value.
107810 * @return {EventStream}
107811 */ function events(source, type, filter4, apply) {
107812 const df = this, s = stream(filter4, apply), send = function(e) {
107813 e.dataflow = df;
107814 try {
107815 s.receive(e);
107816 } catch (error) {
107817 df.error(error);
107818 } finally{
107819 df.run();
107820 }
107821 };
107822 let sources;
107823 if (typeof source === "string" && typeof document !== "undefined") sources = document.querySelectorAll(source);
107824 else sources = (0, _vegaUtil.array)(source);
107825 const n = sources.length;
107826 for(let i = 0; i < n; ++i)sources[i].addEventListener(type, send);
107827 return s;
107828}
107829function parse(data, format) {
107830 const locale = this.locale();
107831 return (0, _vegaLoader.read)(data, format, locale.timeParse, locale.utcParse);

Callers

nothing calls this directly

Calls 4

streamFunction · 0.70
permitFunction · 0.70
trackEventListenerFunction · 0.70
warnMethod · 0.45

Tested by

no test coverage detected