update: Add injection keys

This commit is contained in:
Braks
2021-10-20 22:39:54 +02:00
parent 1853c21353
commit a895853b64
19 changed files with 113 additions and 133 deletions
+4 -4
View File
@@ -1,7 +1,7 @@
<script lang="ts" setup>
import { DraggableEventListener } from '@braks/revue-draggable'
import { RevueFlowHooks } from '~/hooks/RevueFlowHooks'
import { Node, NodeDimensionUpdate, NodeType, RevueFlowStore } from '~/types'
import { Node, NodeDimensionUpdate, NodeType } from '~/types'
import { Hooks, Store } from '~/context/symbols'
interface NodeProps {
node: Node
@@ -21,8 +21,8 @@ const props = withDefaults(defineProps<NodeProps>(), {
selectNodesOnDrag: true,
})
const store = inject<RevueFlowStore>('store')!
const hooks = inject<RevueFlowHooks>('hooks')!
const store = inject(Store)!
const hooks = inject(Hooks)!
provide('NodeIdContext', props.node.id)
const nodeElement = templateRef<HTMLDivElement>('node-element', null)