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

Made the objectStore, index and cursors generic #46

Merged
merged 1 commit into from
Jan 2, 2018

Conversation

mariusGundersen
Copy link
Contributor

This is a small feature to make the ObjectStore be slightly more strongly-typed. It uses generic methods to add types to the ObjectStore, Index and Cursor, but defaults to any if they are missing (just like today). This means the following code works:

const store = tx.ObjecStore<Person>('people');
const jake = await store.get('Jake');//jake is now of type Person
console.log(jake.name);

@jakearchibald jakearchibald merged commit e5e5941 into jakearchibald:master Jan 2, 2018
@jakearchibald
Copy link
Owner

I like it! Thank you

@stefan505
Copy link

This has not been released yet. Doing an NPM install results in the old idb.d.ts file.

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.

None yet

3 participants