Always init

This commit is contained in:
Andras Schmelczer 2025-07-07 22:30:33 +01:00
parent c38b7c9972
commit 70ef5cc0de
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
4 changed files with 20 additions and 59 deletions

View file

@ -1,4 +1,4 @@
import { init, reconcileWithHistory } from 'reconcile';
import { reconcileWithHistory } from 'reconcile';
import type { Tokenizer } from 'reconcile';
import './style.scss';
@ -13,8 +13,6 @@ const tokenizerRadios = document.querySelectorAll(
const sampleText = `The \`reconcile\` Rust library is embedded on this page as a WASM module and powers these text boxes. Experiment with changing the "Original", "First concurrent edit", and "Second concurrent edit" text boxes to see competing changes get merged in real-time within the "Deconflicted result" box. Here, you will see color-coded tokens marking the origin of each token, including ones that got deleted. The result highly depends on the tokenization strategy, for example, deciding how casing or whitespace is taken into account.`;
async function main(): Promise<void> {
await init();
originalTextArea.addEventListener('input', updateMergedText);
leftTextArea.addEventListener('input', updateMergedText);
rightTextArea.addEventListener('input', updateMergedText);