Files
helium/app/state/streamer.ts

16 lines
378 B
TypeScript

import { defineStore} from 'pinia';
export const useStreamerStore = defineStore('streamer', {
state: () => ({
code: '',
peerConnections: {} as Record<string, RTCPeerConnection>,
}),
actions: {
setCode(code: string) {
this.code = code;
},
addPeerConnection(id: string, pc: RTCPeerConnection) {
this.peerConnections[id] = pc;
},
},
});