Fluid container loader providing core container loading functionality for the Fluid Framework
Build a helper that persists unsent collaborative edits when connectivity drops and replays them on restart using the collaboration loader's pending-state resume flow.
savePendingEdits captures a serialized pending-state string and writes it to the store for that session, returning the same string. If the container has no pending local work, it returns undefined and does not overwrite existing entries. @testloadWithPendingRecovery should start the container from that state instead of doing a fresh load, and resolve only after the resumed container reports connectivity. @testloadWithPendingRecovery should call the provided fresh-load factory and return that container without touching the store. @test@generates
export interface PendingStateStore {
read(sessionId: string): Promise<string | undefined>;
write(sessionId: string, serializedState: string): Promise<void>;
clear(sessionId: string): Promise<void>;
}
export interface CollaborationContainer {
readonly connected: boolean;
on(event: "connected" | "disconnected", listener: () => void): void;
once(event: "connected", listener: () => void): void;
}
export interface LoadWithRecoveryConfig {
sessionId: string;
store: PendingStateStore;
loadFresh(): Promise<CollaborationContainer>;
loadFromPending(serializedState: string): Promise<CollaborationContainer>;
onRecovered?(container: CollaborationContainer): Promise<void> | void;
}
export async function savePendingEdits(
container: CollaborationContainer,
store: PendingStateStore,
sessionId: string
): Promise<string | undefined>;
export async function loadWithPendingRecovery(
config: LoadWithRecoveryConfig
): Promise<CollaborationContainer>;Provides collaborative container loading and pending-state resume support needed for capturing and rehydrating local changes.
tessl i tessl/npm-fluidframework--container-loader@2.60.0evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10