Experiment to rebuild Diffuse using web applets.
1import { expose, groupTracksPerScheme, transfer } from "@scripts/common";
2import { CONNECTIONS } from "./constants";
3import type { Track } from "@applets/core/types";
4
5////////////////////////////////////////////
6// ACTIONS
7////////////////////////////////////////////
8const actions = expose({
9 groupTracks,
10});
11
12export type Actions = typeof actions;
13
14// Actions
15
16function groupTracks(tracks: Track[]) {
17 const grouped = groupTracksPerScheme(
18 tracks,
19 Object.fromEntries(
20 Object.entries(CONNECTIONS).map(([k, _v]) => {
21 return [k, []];
22 }),
23 ),
24 );
25
26 return transfer(grouped);
27}