GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — WebStreams/JavaScript/1-readable.js at main · HowProgrammingWorks/WebStreams Expand file tree/ Copy path1-readable.jsMore file actions 26 lines (21 loc) · 483 Bytes / Copy path1-readable.jsFile metadata and controls26 lines (21 loc) · 483 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 'use strict'; const fromIterable = (iterable) => new ReadableStream({ start(controller) { for (const value of iterable) { controller.enqueue(value); } controller.close(); }, }); // Usage const main = async () => { const stream = fromIterable(['a', 'b', 'c', 'd']); const reader = stream.getReader(); while (true) { const { done, value } = await reader.read(); if (done) break; console.log('chunk:', value); } }; main(); |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |