MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / callback

Method callback

examples/commodetto/jpegstream/main.js:26–47  ·  view source on GitHub ↗
(message /*, value, etc */)

Source from the content-addressed store, hash-verified

24 this.reject = dictionary.reject;
25 }
26 callback(message /*, value, etc */) {
27 if (message < 0) {
28 this.reject();
29 return;
30 }
31
32 if (1 == message)
33 this.jpeg = new JPEG();
34 else if (4 == message)
35 this.jpeg.push(this.read(ArrayBuffer));
36 else if (5 == message) {
37 this.jpeg.push();
38 this.resolve();
39 }
40
41 while (this.jpeg.ready) {
42 let block = this.jpeg.read();
43 this.poco.begin(block.x, block.y, block.width, block.height);
44 this.poco.drawBitmap(block, block.x, block.y);
45 this.poco.end();
46 }
47 }
48}
49
50function display(poco, host, path = "/")

Callers

nothing calls this directly

Calls 6

drawBitmapMethod · 0.80
readMethod · 0.65
beginMethod · 0.65
endMethod · 0.65
pushMethod · 0.45
resolveMethod · 0.45

Tested by

no test coverage detected