@microsoft/kiota-abstractions
Version:
Core abstractions for kiota generated libraries in TypeScript and JavaScript
28 lines • 1.46 kB
JavaScript
/**
* -------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License.
* See License in the project root for license information.
* -------------------------------------------------------------------------------------------
*/
import { ParseNodeProxyFactory } from "../serialization/index.js";
/** Proxy implementation of ParseNodeFactory for the backing store that automatically sets the state of the backing store when deserializing. */
export class BackingStoreParseNodeFactory extends ParseNodeProxyFactory {
/**
* Initializes a new instance of the BackingStoreParseNodeFactory class given the concrete implementation.
* @param concrete the concrete implementation of the ParseNodeFactory
*/
constructor(concrete) {
super(concrete, (value) => {
const backedModel = value;
if (backedModel === null || backedModel === void 0 ? void 0 : backedModel.backingStore) {
backedModel.backingStore.initializationCompleted = false;
}
}, (value) => {
const backedModel = value;
if (backedModel === null || backedModel === void 0 ? void 0 : backedModel.backingStore) {
backedModel.backingStore.initializationCompleted = true;
}
});
}
}
//# sourceMappingURL=backingStoreParseNodeFactory.js.map