feat: 后端发布未映射排序的色彩。

This commit is contained in:
2023-04-02 14:52:08 +08:00
parent 9ec030488a
commit 535f731770
6 changed files with 102 additions and 43 deletions

View File

@@ -57,6 +57,21 @@ function App() {
});
});
// listen to led_sorted_colors_changed event
createEffect(() => {
const unlisten = listen<Array<string>>('led_sorted_colors_changed', (event) => {
const sortedColors = event.payload;
setLedStripStore({
sortedColors,
});
});
onCleanup(() => {
unlisten.then((unlisten) => unlisten());
});
});
const [ledStripConfiguration, setLedStripConfiguration] = createStore<
LedStripConfigurationContextType[0]
>({