Files
simple-chats/src/main.ts
2024-06-12 14:34:28 +08:00

26 lines
528 B
TypeScript

import './app.pcss';
import App from './App.svelte';
import type { Comment } from '@onecomme.com/onesdk/types/Comment';
import { chats } from './chats';
if (import.meta.env.DEV) {
globalThis.OneSDK = (await import('@onecomme.com/onesdk')).default;
}
OneSDK.subscribe({
action: 'comments',
callback: ((res: Comment[]) => {
chats.set(res);
}) as any
});
OneSDK.setup({
commentLimit: 30
});
OneSDK.connect();
const app = new App({
target: document.getElementById('app')!
});
export default app;