Skip to content

Conversation

@utanapishtim
Copy link
Contributor

This change allows put to return the key and value passed to it upon a successful write.

test/all.js Outdated
for (const test of tests) {
const feed = new Hypercore(require('random-access-memory'))
const db = new Hyperbee(feed, test.opts)
await db.ready()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed

test/all.js Outdated
const Hypercore = require('hypercore')
for (const test of tests) {
const feed = new Hypercore(require('random-access-memory'))
const db = new Hyperbee(feed, test.opts)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the create helper

test/all.js Outdated
await db.ready()
const result = await db.put(test.key, test.value)
test.t(result, test.key, test.value)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually this loop doesn't help much with clarity. just duplicate the creation between three independent tests instead and use the create helper :)

@gmaclennan
Copy link

Came here looking for this functionality 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants