UNPKG
@jameshclrk/rxdb-hooks
Version:
latest (6.0.1)
6.0.1
React hooks for integrating with RxDB
github.com/jameshclrk/rxdb-hooks
jameshclrk/rxdb-hooks
@jameshclrk/rxdb-hooks
/
src
/
useRxDB.ts
11 lines
(8 loc)
•
267 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
import
{ useContext }
from
'react'
;
import
Context
from
'./context'
;
import
{
RxDatabaseBaseExtended
}
from
'./plugins'
;
function
useRxDB
(
dbName: string
):
RxDatabaseBaseExtended
{
const
{ dbs } =
useContext
(
Context
);
return
dbs[dbName]; }
export
default
useRxDB;