import { useState, useEffect } from "preact/hooks"; import preactLogo from "./assets/preact.svg"; import init, { Loro } from "loro-wasm"; import "./app.css"; init(); export function App() { const [count, setCount] = useState(0); useEffect(() => { (async () => { await init(); const loro = new Loro(); const a = loro.getText("ha"); a.insert(loro, 0, "hello world"); a.delete(loro, 6, 5); a.insert(loro, 6, "everyone"); console.log(a.value); const b = loro.getMap("ha"); b.set(loro, "ab", 123); console.log(b.value); console.log(a.value); })(); }, []); return ( <>

Vite + Preact

Edit src/app.tsx and save to test HMR

Click on the Vite and Preact logos to learn more

); }