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

Function GraphSerializer

devtool/src/graphSerializer.ts:291–312  ·  view source on GitHub ↗
(sources: GraphSerializerSources)

Source from the content-addressed store, hash-verified

289}
290
291function GraphSerializer(sources: GraphSerializerSources): GraphSerializerSinks {
292 let zapSpeed$ = sources.Settings.map(settings =>
293 (sources.FromPanel as Stream<ZapSpeed>).startWith(settings.zapSpeed),
294 ).flatten();
295
296 let graph$ = sources.DebugSinks
297 .filter(sinksAreXStream)
298 .map(buildGraph);
299
300 let serializedGraph$ = xs.combine(graph$, zapSpeed$)
301 .map(setupZapping)
302 .compose(makeObjectifyGraph(sources.id))
303 .map(object => CircularJSON.stringify(object));
304
305 let invalid$ = sources.DebugSinks
306 .filter(x => !sinksAreXStream(x))
307 .mapTo('');
308
309 return {
310 graph: xs.merge(serializedGraph$, invalid$),
311 };
312}
313
314const panelMessage$ = xs.create<string>({
315 start(listener: Listener<string>) {

Callers 1

startGraphSerializerFunction · 0.85

Calls 4

makeObjectifyGraphFunction · 0.85
sinksAreXStreamFunction · 0.85
mapMethod · 0.65
filterMethod · 0.65

Tested by

no test coverage detected