MCPcopy Create free account
hub / github.com/cyclejs/cyclejs / startGraphSerializer

Function startGraphSerializer

devtool/src/graphSerializer.ts:325–351  ·  view source on GitHub ↗
(appSinks: Object | null)

Source from the content-addressed store, hash-verified

323let started = false;
324
325function startGraphSerializer(appSinks: Object | null) {
326 if (started) {
327 return;
328 }
329 const serializerSources: GraphSerializerSources = {
330 id: xs.of(`graph-${Math.round(Math.random() * 1000000000)}`),
331 DebugSinks: xs.of(appSinks),
332 FromPanel: panelMessage$,
333 Settings: xs.of<SessionSettings>(window['CyclejsDevToolSettings']),
334 };
335 const serializerSinks = GraphSerializer(serializerSources);
336
337 serializerSinks.graph.addListener({
338 next: graph => {
339 // console.log('GRAPH SERIALIZER send message to CONTENT SCRIPT: ' + graph);
340 // Send message to the CONTENT SCRIPT
341 const event = new CustomEvent('CyclejsDevToolEvent', {detail: graph});
342 document.dispatchEvent(event);
343 },
344 error: (err: any) => {
345 console.error('Cycle.js DevTool (graph serializer):\n' + err);
346 console.error(err.stack);
347 },
348 complete: () => {},
349 });
350 started = true;
351}
352
353window['CyclejsDevTool_startGraphSerializer'] = startGraphSerializer;
354

Callers 1

graphSerializer.tsFile · 0.85

Calls 2

GraphSerializerFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected