I'm having trouble understanding, why the following works, that is, why the invocations of the read() function actually return the objects stored in the readable stream.
const { Readable } = require('stream')
var r = new Readable({objectMode: true, read: () => {}}) // dummy read
var a = [1,2,3,4,5,6,7]
r.push(...a)
Now, when I invoke r.read() I get the numbers I pushed into my readable stream r
r.read() // -> 1
r.read() // -> 2
// etc
But I provided a "dummy" read function (read: () => {}) above when creating my readable stream. So, why do I get values back, when calling read?
Help will be much appreciated.