Open creationix opened 7 years ago
In the readme, you mention that the hypercore feed can be faked with:
any append-only log that supports .append() and .length
.append()
.length
But in testing, I found more was needed. So I made a simple minimal interface.
// Fake hypercore feed for testing and learning var values = [] var feed = { append (value, cb) { console.log('APPEND', {value, cb}) values.push(value) nextTick(cb) }, get (index, options, cb) { console.log('GET', {index, options, cb}) nextTick(cb, null, values[index]) }, get length () { console.log('LENGTH') return values.length }, ready (cb) { console.log('READY', {cb}) nextTick(cb) } }
Maybe mention it needs all 4 and .length is a getter.
In the readme, you mention that the hypercore feed can be faked with:
But in testing, I found more was needed. So I made a simple minimal interface.