MCPcopy
hub / github.com/callumalpass/tasknotes / configureToggleSetting

Function configureToggleSetting

src/settings/components/settingHelpers.ts:164–173  ·  view source on GitHub ↗
(setting: Setting, options: ToggleSettingOptions)

Source from the content-addressed store, hash-verified

162 * Helper for configuring a toggle setting (works with SettingGroup.addSetting)
163 */
164export function configureToggleSetting(setting: Setting, options: ToggleSettingOptions): Setting {
165 return setting
166 .setName(options.name)
167 .setDesc(options.desc)
168 .addToggle((toggle) => {
169 toggle.setValue(options.getValue()).onChange((value) => {
170 runAsyncSettingCallback(() => options.setValue(value));
171 });
172 });
173}
174
175/**
176 * Helper for creating standard toggle settings

Callers 6

renderGeneralTabFunction · 0.90
renderIntegrationsTabFunction · 0.90
renderModalFieldsTabFunction · 0.90
renderFeaturesTabFunction · 0.90
renderAppearanceTabFunction · 0.90
createToggleSettingFunction · 0.85

Calls 7

runAsyncSettingCallbackFunction · 0.85
setDescMethod · 0.80
setValueMethod · 0.65
addToggleMethod · 0.45
setNameMethod · 0.45
onChangeMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected