Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

516 B
Raw Blame
import { isTauri } from '../../internal/platform';
import {
  browserWebSocketFactory,
  type WebSocketFactory,
} from './minimal-websocket';
import { tauriWebSocketFactory } from './tauri-websocket';

/**
 * Dynamic WebSocket factory that returns the right websocket wrapper
 * depending on the platform
 */
export const platformWebSocketFactory: WebSocketFactory = (url, protocols) => {
  if (isTauri()) {
    return tauriWebSocketFactory(url, protocols);
  }

  return browserWebSocketFactory(url, protocols);
};