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
@@ -1,7 +1,7 @@
<script lang="ts" setup>
import { HTMLAttributes } from 'vue'
import { BackgroundVariant } from '~/types'
import { Store } from '~/context'
import { useStore } from '~/composables'
export interface BackgroundProps extends HTMLAttributes {
variant?: BackgroundVariant
@@ -21,7 +21,7 @@ const defaultColors: Record<BackgroundVariant, string> = {
[BackgroundVariant.Lines]: '#eee',
}
const store = inject(Store)!
const store = useStore()
// when there are multiple flows on a page we need to make sure that every background gets its own pattern.
const bgClasses = ['revue-flow__background']