auto-sync

This commit is contained in:
2023-07-05 18:19:53 +02:00
parent c1c0193dae
commit b7c9c8941b
5 changed files with 73 additions and 23 deletions

View File

@@ -5,3 +5,9 @@ export const serialPort = writable()
/** @type {import('svelte/store').Writable<Array<{type: 'input' | 'output' | 'system'; value: string}>>} */
export const serialLog = writable([])
/** @type {import('svelte/store').Writable<Array<{actions: number[]; phrase: string}>>} */
export const chords = writable([])
/** @type {import('svelte/store').Writable<boolean>} */
export const syncing = writable(false)

View File

@@ -61,6 +61,7 @@ export class CharaDevice {
*/
async #read() {
return this.#reader.then(async it => {
/** @type {string} */
const result = await it.read().then(({value}) => value)
serialLog.update(it => {
it.push({