Skip to content

The open-source full-stack studio for Opus 5.5 motion video. Reverse engineering for any video. Code video with HTML: recreate, edit and render. BYOA + BYOK · Motion.md · Images, Video, Music & Voice.

522 B
Raw Blame
type ExternalFileReloadListener = (path: string) => void;

const listeners = new Set<ExternalFileReloadListener>();

export function addExternalFileReloadListener(listener: ExternalFileReloadListener): () => void {
  listeners.add(listener);
  return () => listeners.delete(listener);
}

export function notifyExternalFileReload(path: string): void {
  for (const listener of listeners) {
    try {
      listener(path);
    } catch {
      // A stale SDK owner must not prevent sibling owners from reloading.
    }
  }
}