useImportSource.ts 432 B

123456789101112131415
  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('import-source')
  5. export const useImportSource = () => {
  6. return inject(IMPORT_SOURCE) as ImportSource
  7. }
  8. export const provideImportSource = (importSource: ImportSource) => {
  9. provide(IMPORT_SOURCE, importSource)
  10. }