UNPKG
dexie-react-hooks
Version:
latest (1.1.7)
next (4.1.0-beta.46)
test (4.1.0-beta.47)
4.1.0-beta.47
4.1.0-beta.46
4.1.0-beta.45
4.1.0-beta.43
4.1.0-alpha.23
4.1.0-alpha.3
1.2.0-beta.1
1.1.7
1.1.6
1.1.5
1.1.4
1.1.3
1.1.1
1.1.0
1.1.0-rc.1
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.3-alpha.1
1.0.2
1.0.1
1.0.0
React hooks for reactive data fetching using Dexie.js
dexie.org
dexie/Dexie.js
dexie-react-hooks
/
test
/
utils
/
closest.ts
5 lines
(4 loc)
•
173 B
text/typescript
View Raw
1
2
3
4
5
export
function
closest
(
node: Node, selector: string
) {
const
element = node.
nodeType
===
1
? node
as
Element
: node.
parentElement
;
return
element?.
closest
(selector); }