Hiyve Components - v1.0.0
    Preparing search index...

    Interface UseUserFilesBroadcastResult

    interface UseUserFilesBroadcastResult {
        notifyChange: (
            payload:
                | { fileId: string; kind: "removed" }
                | {
                    file: UserFile;
                    fileId: string;
                    kind: "shared";
                    sharedWith: string[];
                }
                | { kind: "changed" },
        ) => void;
    }
    Index

    Properties

    Properties

    notifyChange: (
        payload:
            | { fileId: string; kind: "removed" }
            | { file: UserFile; fileId: string; kind: "shared"; sharedWith: string[] }
            | { kind: "changed" },
    ) => void

    Broadcast a file-system change message to every other participant in the relay context. Fire-and-forget — no ack, no retry — so it's safe to call after every local mutation without backpressure concerns. No-op when the relay isn't connected yet.

    Pass { kind: 'removed', fileId } after a delete so receivers can drop the file from local state instantly. Pass { kind: 'shared', fileId, file, sharedWith } after a share or unshare so receivers apply the new ACL directly (no server refetch — bypasses the cloud read-replica race that produced "shared but the student doesn't see it"). Pass { kind: 'changed' } for everything else (rename / move / content updates / folder ops); receivers refetch.