refactor: everything to nuxt.js

This commit is contained in:
2026-03-19 14:30:36 -04:00
parent 6e1f58cd8e
commit bb3042014e
159 changed files with 6786 additions and 11198 deletions

20
app/stores/realtime.ts Normal file
View File

@@ -0,0 +1,20 @@
import { defineStore } from 'pinia';
import { client } from '~/utils/appwrite';
import { ref } from 'vue';
import type { RealtimeResponseEvent } from 'appwrite';
export const useRealtimeStore = defineStore('realtime', () => {
const subscriptions = ref<Map<string, () => void>>(new Map());
const register = (
channel: string,
fn: (response: RealtimeResponseEvent<unknown>) => void
) => {
if (subscriptions.value.has(channel)) return;
subscriptions.value.set(channel, client.subscribe(channel, fn));
};
return {
register,
};
});