pocketbase login
This commit is contained in:
13
src/pocketbase/pocketbase.ts
Normal file
13
src/pocketbase/pocketbase.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import PocketBase from 'pocketbase';
|
||||
import { App, inject } from 'vue';
|
||||
|
||||
const pocketBaseSymbol = Symbol('pocketBase');
|
||||
|
||||
export const providePocketBase = (app: App) => {
|
||||
const pb = new PocketBase('/pocketbase/');
|
||||
|
||||
app.provide(pocketBaseSymbol, pb);
|
||||
return pb;
|
||||
}
|
||||
|
||||
export const usePocketBase = () => inject<PocketBase>(pocketBaseSymbol)!;
|
||||
Reference in New Issue
Block a user