cvara / rxdb-hooks

React hooks for integrating with RxDB
MIT License
132 stars 5 forks source link

How to handle multiple databases? #55

Closed HZSamir closed 1 year ago

HZSamir commented 1 year ago

Hello, Assuming I have two databases, and would like to access either through useRxDB, how would I go about it, knowing the Provider component only takes one instance of RxDB? Thank you.

cvara commented 1 year ago

Hello, one way to do it would be to nest multiple Providers, each providing the db instance that is needed by its component sub-tree.

For an example please see #56

HZSamir commented 1 year ago

Thank you very much. Closing this.