MCPcopy Create free account
hub / github.com/WinterTC55/iter-streams / JsonMessage

Class JsonMessage

samples/01-basic-creation.ts:186–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184 {
185 // Define a class that implements the ToStreamable protocol
186 class JsonMessage {
187 constructor(private data: object) {}
188
189 // The protocol method - returns sync streamable yield
190 [Stream.toStreamable](): string {
191 return JSON.stringify(this.data);
192 }
193 }
194
195 // Create a generator that yields JsonMessage objects
196 function* messageSource() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected