assuncaocharles / react-indexed-db

A service that wraps IndexedDB database in an Declarative way. It exposes very simple promises API to enable the usage of IndexedDB without most of it plumbing.
MIT License
110 stars 37 forks source link

Accessing multiple object store #33

Open darshanksexathought opened 3 years ago

darshanksexathought commented 3 years ago

How to access multiple object store data <IndexedDB name={Constants.IdbDBConfig.name} version={1} objectStoresMeta={[Constants.indexDbSchema, Constants.indexDbSchema.plant]}>

//----> here I can only access one store {({ add, getAll, update , getByID}) => { }}
            </IndexedDB>

creating multiple store is also not working it creates only first store in the objectStoreMeta

jobindcruz commented 3 years ago

@darshanksexathought

Creating multiple store is working. Check this

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

crlsmtzprds commented 1 year ago

You can use aliases for methods...

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