react-indexed-db icon indicating copy to clipboard operation
react-indexed-db copied to clipboard

Accessing multiple object store

Open darshanksexathought opened this issue 4 years ago • 2 comments

How to access multiple object store data <IndexedDB name={Constants.IdbDBConfig.name} version={1} objectStoresMeta={[Constants.indexDbSchema, Constants.indexDbSchema.plant]}> <AccessDB objectStore={Constants.indexDbSchema.store}> //----> here I can only access one store {({ add, getAll, update , getByID}) => { }} </AccessDB> </IndexedDB> creating multiple store is also not working it creates only first store in the objectStoreMeta

darshanksexathought avatar Dec 30 '20 17:12 darshanksexathought

@darshanksexathought

Creating multiple store is working. Check this

https://github.com/assuncaocharles/react-indexed-db/issues/5

jobindcruz avatar Aug 14 '21 17:08 jobindcruz

You can use aliases for methods...

let { add : myCustnomAddName, getAll : myCustom } = useIndexedDB('model')

crlsmtzprds avatar Dec 07 '22 19:12 crlsmtzprds