MCPcopy Create free account
hub / github.com/json-editor/json-editor / refreshWatchedFieldValues

Method refreshWatchedFieldValues

src/editor.js:479–499  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

477 }
478
479 refreshWatchedFieldValues () {
480 if (!this.watched_values) return
481 const watched = {}
482 let changed = false
483
484 if (this.watched) {
485 Object.keys(this.watched).forEach(name => {
486 const editor = this.jsoneditor.getEditor(this.watched[name])
487 const val = editor ? editor.getValue() : null
488 if (this.watched_values[name] !== val) changed = true
489 watched[name] = val
490 })
491 }
492
493 watched.self = this.getValue()
494 if (this.watched_values.self !== watched.self) changed = true
495
496 this.watched_values = watched
497
498 return changed
499 }
500
501 getWatchedFieldValues () {
502 return this.watched_values

Callers 1

setupWatchListenersMethod · 0.95

Calls 2

getValueMethod · 0.95
getEditorMethod · 0.80

Tested by

no test coverage detected