WOOP WOOP, file save works!!!
This commit is contained in:
parent
5367ed2f44
commit
c02fb2d924
2 changed files with 3 additions and 5 deletions
|
@ -89,7 +89,7 @@ const states = {
|
||||||
async function* parse(stream: ReadableStream<Uint8Array>): AsyncGenerator<any, void, unknown> {
|
async function* parse(stream: ReadableStream<Uint8Array>): AsyncGenerator<any, void, unknown> {
|
||||||
let state = states.none();
|
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 {
|
try {
|
||||||
state = state(token);
|
state = state(token);
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,10 +152,6 @@ export default function Edit(props: ParentProps) {
|
||||||
}).toArray();
|
}).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
|
// Since the files are stored in indexedDb we need to refetch on the client in order to populate on page load
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
getRoot();
|
getRoot();
|
||||||
|
@ -226,6 +222,8 @@ export default function Edit(props: ParentProps) {
|
||||||
const stream = await handle.createWritable({ keepExistingData: false });
|
const stream = await handle.createWritable({ keepExistingData: false });
|
||||||
|
|
||||||
stream.write(JSON.stringify(data, null, 4));
|
stream.write(JSON.stringify(data, null, 4));
|
||||||
|
stream.write('\n');
|
||||||
|
stream.close();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
console.log(results);
|
console.log(results);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue