feat: add useStore and useHooks composables that provide default store/hooks

This commit is contained in:
Braks
2021-10-20 22:39:54 +02:00
parent 61dc9dea33
commit b2b1fe822f
27 changed files with 174 additions and 128 deletions
+3 -3
View File
@@ -1,8 +1,8 @@
import { ElementId, UpdateNodeInternals } from '~/types'
import { Store } from '~/context'
import useStore from '~/composables/useStore'
export default function (): UpdateNodeInternals {
const store = inject(Store)!
export default (): UpdateNodeInternals => {
const store = useStore()
return (id: ElementId) => {
const nodeElement: HTMLDivElement | null = document.querySelector(`.revue-flow__node[data-id="${id}"]`)