This repository has been archived by the owner on Apr 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f58beb8
commit 87b90cd
Showing
6 changed files
with
47 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export const useSurreal = () => { | ||
const { $surreal } = useNuxtApp() | ||
return $surreal | ||
} | ||
const { $surreal } = useNuxtApp(); | ||
return $surreal; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import { Surreal } from "surrealdb.js" | ||
import { Surreal } from 'surrealdb.js'; | ||
|
||
export const surreal: Surreal = new Surreal() | ||
export const surreal: Surreal = new Surreal(); | ||
|
||
export default defineNuxtPlugin(async (nuxtApp) => { | ||
export default defineNuxtPlugin(async () => { | ||
await surreal.connect(import.meta.env.VITE_SURREAL_ENDPOINT, { | ||
namespace: import.meta.env.VITE_SURREAL_NAMESPACE ?? 'leafal-io', | ||
database: | ||
import.meta.env.VITE_SURREAL_DATABASE ?? | ||
'leafal-io-deployment_local', | ||
}) | ||
}); | ||
|
||
return { | ||
provide: { surreal } | ||
} | ||
}) | ||
provide: { surreal }, | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import type { Surreal } from "surrealdb.js" | ||
import type { Surreal } from 'surrealdb.js'; | ||
|
||
declare module '#app' { | ||
interface NuxtApp { | ||
$surreal: Surreal | ||
$surreal: Surreal; | ||
} | ||
} | ||
|
||
declare module 'vue' { | ||
interface ComponentCustomProperties { | ||
$surreal: Surreal | ||
$surreal: Surreal; | ||
} | ||
} | ||
|
||
export { } | ||
export {}; |