-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathLDTransactionalDataSourceUpdates.ts
More file actions
28 lines (26 loc) · 1.26 KB
/
LDTransactionalDataSourceUpdates.ts
File metadata and controls
28 lines (26 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { internal } from '@launchdarkly/js-sdk-common';
import { LDDataSourceUpdates } from './LDDataSourceUpdates';
import { LDFeatureStoreDataStorage } from './LDFeatureStore';
/**
* Transactional version of {@link LDDataSourceUpdates} with support for {@link applyChanges}
*/
export interface LDTransactionalDataSourceUpdates extends LDDataSourceUpdates {
/**
* @param basis If true, completely overwrites the current contents of the data store
* with the provided data. If false, upserts the items in the provided data. Upserts
* are made only if provided items have newer versions than existing items.
* @param data An object in which each key is the "namespace" of a collection (e.g. `"features"`) and
* the value is an object that maps keys to entities. The actual type of this parameter is
* `interfaces.FullDataSet<VersionedData>`.
* @param callback Will be called after the changes are applied.
* @param initMetadata Optional metadata to initialize the data source with.
* @param selector opaque string that uniquely identifies the state that contains the changes
*/
applyChanges(
basis: boolean,
data: LDFeatureStoreDataStorage,
callback: () => void,
initMetadata?: internal.InitMetadata,
selector?: string,
): void;
}