init
This commit is contained in:
25
src/main.ts
Normal file
25
src/main.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user