(sources: GraphSerializerSources)
| 289 | } |
| 290 | |
| 291 | function 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 | |
| 314 | const panelMessage$ = xs.create<string>({ |
| 315 | start(listener: Listener<string>) { |
no test coverage detected