🎨 format

This commit is contained in:
Rune Harlyk
2025-10-11 10:42:32 +02:00
parent 4d51b9f556
commit 91a7b170fe
139 changed files with 6645 additions and 6317 deletions
+12 -12
View File
@@ -1,7 +1,7 @@
import { writable } from 'svelte/store';
import type { IMU } from '$lib/types/models';
import { writable } from 'svelte/store'
import type { IMU } from '$lib/types/models'
const maxIMUData = 100;
const maxIMUData = 100
export const imu = (() => {
const { subscribe, update } = writable({
@@ -12,16 +12,16 @@ export const imu = (() => {
altitude: [] as number[],
pressure: [] as number[],
bmp_temp: [] as number[]
});
})
const addData = (content: IMU) => {
update(data => {
(Object.keys(content) as (keyof IMU)[]).forEach(key => {
data[key] = [...data[key], content[key]].slice(-maxIMUData);
});
return data;
});
};
;(Object.keys(content) as (keyof IMU)[]).forEach(key => {
data[key] = [...data[key], content[key]].slice(-maxIMUData)
})
return data
})
}
return { subscribe, addData };
})();
return { subscribe, addData }
})()