useImportSource.ts 430 B

1234567891011121314
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import { inject, provide } from 'vue'
  3. import type { ImportSource } from '../types/setup-import.ts'
  4. export const IMPORT_SOURCE = Symbol('ImportSource')
  5. export const useImportSource = () => {
  6. return inject(IMPORT_SOURCE) as ImportSource
  7. }
  8. export const provideImportSource = (importSource: ImportSource) => {
  9. provide(IMPORT_SOURCE, importSource)
  10. }