MCPcopy Create free account
hub / github.com/chieapp/chie / update

Method update

src/view/params-view.ts:129–149  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

127 }
128
129 update() {
130 let selections = this.selections;
131 if (this.param.constrain && this.constrainedBy) {
132 const controllingValue = this.constrainedBy.getValue();
133 if (controllingValue)
134 selections = selections.filter(s => this.param.constrain(controllingValue, s.value));
135 else
136 selections = [];
137 }
138 this.editor.clear();
139 if (this.nullable)
140 this.editor.addItem('');
141 for (const selection of selections)
142 this.editor.addItem(selection.name);
143 if (typeof this.param.selected == 'string')
144 this.#setSelected(this.param.selected);
145 else if (this.param.value)
146 this.setValue(this.param.value);
147 if (this.description)
148 this.#updateDescription();
149 }
150
151 subscribeOnChange(callback: () => void) {
152 this.connectYueSignal(this.editor.onSelectionChange, callback);

Callers 2

constructorMethod · 0.95
#setSelectedMethod · 0.45

Calls 6

#setSelectedMethod · 0.95
setValueMethod · 0.95
#updateDescriptionMethod · 0.95
clearMethod · 0.80
addItemMethod · 0.80
getValueMethod · 0.45

Tested by

no test coverage detected