Skip to content

Commit

Permalink
feat(composable): add emitter
Browse files Browse the repository at this point in the history
  • Loading branch information
antonreshetov committed Mar 29, 2022
1 parent 6d56cb5 commit 80f7fc5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/renderer/composable/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { createFetch } from '@vueuse/core'
import mitt from 'mitt'
import type { Events } from './types'

export const useApi = createFetch({
baseUrl: `http://localhost:${import.meta.env.VITE_APP_API_PORT}`
})

export const emitter = mitt<Events>()
3 changes: 3 additions & 0 deletions src/renderer/composable/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export type Events = {
'focus:snippet-name': boolean
}

0 comments on commit 80f7fc5

Please sign in to comment.