-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
changes put to return key and value passed #46
base: main
Are you sure you want to change the base?
Conversation
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() |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) | ||
} |
There was a problem hiding this comment.
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 :)
Came here looking for this functionality 👍 |
This change allows put to return the key and value passed to it upon a successful write.