Skip to content

Commit adf70e8

Browse files
committed
#6937 core.Config: default merge strategy => replace, JSDoc comments polishing
1 parent 7643e2e commit adf70e8

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

src/core/Config.mjs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,18 @@ class Config {
2323
/**
2424
* A Set to store callback functions that subscribe to changes in this config's value.
2525
* @private
26-
* @apps/portal/view/about/MemberContainer.mjs {Set<Function>} #subscribers
2726
*/
2827
#subscribers = new Set();
2928

3029
/**
3130
* The strategy to use when merging new values into this config.
32-
* Defaults to 'deep'. Can be overridden via a descriptor.
33-
* @apps/portal/view/about/MemberContainer.mjs {string} mergeStrategy
31+
* Defaults to 'replace'. Can be overridden via a descriptor.
3432
*/
35-
mergeStrategy = 'deep';
33+
mergeStrategy = 'replace';
3634

3735
/**
3836
* The function used to compare new and old values for equality.
3937
* Defaults to `Neo.isEqual`. Can be overridden via a descriptor.
40-
* @apps/portal/view/about/MemberContainer.mjs {Function} isEqual
4138
*/
4239
isEqual = Neo.isEqual;
4340

@@ -73,9 +70,9 @@ class Config {
7370
initDescriptor({isEqual, merge, value}) {
7471
let me = this;
7572

76-
me.#value = value
77-
me.mergeStrategy ??= merge;
73+
me.#value = value;
7874
me.isEqual ??= isEqual
75+
me.mergeStrategy ??= merge
7976
}
8077

8178
/**
@@ -85,7 +82,7 @@ class Config {
8582
*/
8683
notify(newValue, oldValue) {
8784
for (const callback of this.#subscribers) {
88-
callback(newValue, oldValue);
85+
callback(newValue, oldValue)
8986
}
9087
}
9188

0 commit comments

Comments
 (0)