[ide-react] Preserve scope value update watchers on watcher add (#16729)
GitOrigin-RevId: 1168577364fef6e13a58d7d96afdf4ba685fc342
This commit is contained in:
+3
-1
@@ -273,7 +273,9 @@ export class ReactScopeValueStore implements ScopeValueStore {
|
||||
// useScopeValue, during which the value could change without being
|
||||
// observed
|
||||
if ('value' in item) {
|
||||
this.scheduleWatcherUpdate<T>(path, item.value, [watcher])
|
||||
// add this watcher to any existing watchers scheduled for this path
|
||||
const { watchers } = this.watcherUpdates.get(path) ?? { watchers: [] }
|
||||
this.scheduleWatcherUpdate<T>(path, item.value, [...watchers, watcher])
|
||||
}
|
||||
|
||||
return () => {
|
||||
|
||||
Reference in New Issue
Block a user