Skip to content
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

Feature: put passes the key of the created/updated record to callback #20

Closed
glsignal opened this issue Jan 15, 2015 · 2 comments
Closed

Comments

@glsignal
Copy link

I've made use of this behaviour in the vanilla IndexedDB interface and found it very useful.

When creating/updating records on an object store using IDBObjectStore.put, the onsuccess event handler will be passed the record's key as result:

objectStore.put(record).onsuccess = function(evt) {
  console.log(evt.target.result); // record's key
};

It would be helpful, for myself at least, if treo implemented this behaviour perhaps something like this:

treoStore.put(record, function(key) {
  console.log(key); // record's key
});

What are your thoughts?

@alekseykulikov
Copy link
Contributor

Agreed that it's useful. Especially with autoIncrement, will be implemented in 0.4.0

@glsignal
Copy link
Author

👍 Excellent :)

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

No branches or pull requests

2 participants