diff --git a/src/features/file/parser/json.ts b/src/features/file/parser/json.ts index 61963e5..e940cbd 100644 --- a/src/features/file/parser/json.ts +++ b/src/features/file/parser/json.ts @@ -89,7 +89,7 @@ const states = { async function* parse(stream: ReadableStream): AsyncGenerator { let state = states.none(); - for await (const token of take(tokenize(read(toGenerator(stream))), 100)) { + for await (const token of tokenize(read(toGenerator(stream)))) { try { state = state(token); } diff --git a/src/routes/(editor)/edit.tsx b/src/routes/(editor)/edit.tsx index 1eb67de..03128e3 100644 --- a/src/routes/(editor)/edit.tsx +++ b/src/routes/(editor)/edit.tsx @@ -152,10 +152,6 @@ export default function Edit(props: ParentProps) { }).toArray(); }); - createEffect(() => { - console.log(mutatedData()); - }); - // Since the files are stored in indexedDb we need to refetch on the client in order to populate on page load onMount(() => { getRoot(); @@ -226,6 +222,8 @@ export default function Edit(props: ParentProps) { const stream = await handle.createWritable({ keepExistingData: false }); stream.write(JSON.stringify(data, null, 4)); + stream.write('\n'); + stream.close(); })); console.log(results);