feat: add events app + "multi-tenants" aka multi-events
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { inject, provide, type InjectionKey } from 'vue'
|
||||
|
||||
export const EventPathKey: InjectionKey<string> = Symbol('eventPath')
|
||||
|
||||
export function provideEventPath(eventPath: string) {
|
||||
provide(EventPathKey, eventPath)
|
||||
}
|
||||
|
||||
export function useEventPath(): string {
|
||||
const eventPath = inject(EventPathKey)
|
||||
if (!eventPath) {
|
||||
throw new Error('useEventPath() called without a provided eventPath - is this component mounted under a page that calls provideEventPath()?')
|
||||
}
|
||||
return eventPath
|
||||
}
|
||||
Reference in New Issue
Block a user