From 92cb1cc99480d02716bc1171c6a8e268a7c64bc2 Mon Sep 17 00:00:00 2001 From: Vladimir Piskarev Date: Tue, 27 Aug 2024 17:27:30 +0300 Subject: [PATCH] Add support for reverting a composite saveable --- packages/core/src/browser/saveable.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/core/src/browser/saveable.ts b/packages/core/src/browser/saveable.ts index e1a413b3fab0e..fff0ae99a6297 100644 --- a/packages/core/src/browser/saveable.ts +++ b/packages/core/src/browser/saveable.ts @@ -135,6 +135,10 @@ export class CompositeSaveable implements Saveable { await Promise.all(this.saveables.map(saveable => saveable.save(options))); } + async revert(options?: Saveable.RevertOptions): Promise { + await Promise.all(this.saveables.map(saveable => saveable.revert?.(options))); + } + get saveables(): readonly Saveable[] { return Array.from(this.saveablesMap.keys()); }