@soundworks/core 3.1.0-beta.3 → 3.1.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/common/ParameterBag.js
CHANGED
|
@@ -488,12 +488,7 @@ class ParameterBag {
|
|
|
488
488
|
|
|
489
489
|
const currentValue = this._values[name];
|
|
490
490
|
const updated = !(0, _fastDeepEqual.default)(currentValue, value);
|
|
491
|
-
this._values[name] = value;
|
|
492
|
-
|
|
493
|
-
if (def.event === true) {
|
|
494
|
-
this._values[name] = null;
|
|
495
|
-
} // return tuple so that the state manager can handle the `filterChange` option
|
|
496
|
-
|
|
491
|
+
this._values[name] = value; // return tuple so that the state manager can handle the `filterChange` option
|
|
497
492
|
|
|
498
493
|
return [value, updated];
|
|
499
494
|
}
|
package/common/SharedState.js
CHANGED
|
@@ -187,7 +187,18 @@ ${JSON.stringify(initValues, null, 2)}`);
|
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
await Promise.all(promises);
|
|
190
|
+
await Promise.all(promises); // reset events to null after propagation of all listeners
|
|
191
|
+
|
|
192
|
+
for (let name in newValues) {
|
|
193
|
+
const {
|
|
194
|
+
event
|
|
195
|
+
} = this._parameters.getSchema(name);
|
|
196
|
+
|
|
197
|
+
if (event) {
|
|
198
|
+
this._parameters.set(name, null);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
191
202
|
return newValues;
|
|
192
203
|
}
|
|
193
204
|
/**
|
|
@@ -255,7 +266,7 @@ ${JSON.stringify(initValues, null, 2)}`);
|
|
|
255
266
|
|
|
256
267
|
const [newValue, changed] = this._parameters.set(name, updates[name]);
|
|
257
268
|
|
|
258
|
-
if (changed || filterChange === false) {
|
|
269
|
+
if (changed || filterChange === false || event) {
|
|
259
270
|
immediateOldValues[name] = oldValue;
|
|
260
271
|
immediateNewValues[name] = newValue;
|
|
261
272
|
propagateNow = true;
|
|
@@ -81,8 +81,14 @@ class SharedStatePrivate {
|
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
const {
|
|
84
|
+
event,
|
|
84
85
|
filterChange
|
|
85
|
-
} = this._parameters.getSchema(name);
|
|
86
|
+
} = this._parameters.getSchema(name); // if event type reset internal value to null
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
if (event) {
|
|
90
|
+
this._parameters.set(name, null);
|
|
91
|
+
}
|
|
86
92
|
|
|
87
93
|
if (filterChange && changed || !filterChange) {
|
|
88
94
|
filteredUpdates[name] = newValue;
|