cadfa70e60
* #708 apply strictier linting rules and fix simple eslint bugs * #708 fix eslint errors relate to promise * #708 fix eslint import/no-extraneous-dependencies * #708 fix eslint errors of react-hook * #708 enable eslint check for typescript --------- Co-authored-by: lethemanh <lethemanh@lethemanhs-MacBook-Pro.local>
17 lines
350 B
TypeScript
17 lines
350 B
TypeScript
export function registerToCalendars(
|
|
socket: WebSocket,
|
|
calendarURIList: string[]
|
|
): void {
|
|
if (socket.readyState !== WebSocket.OPEN) {
|
|
throw new Error('Cannot register: WebSocket is not open')
|
|
}
|
|
|
|
socket.send(
|
|
JSON.stringify({
|
|
register: calendarURIList
|
|
})
|
|
)
|
|
|
|
console.info('Registered to calendars', calendarURIList)
|
|
}
|