MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / addSelector

Method addSelector

static/settings.ts:326–336  ·  view source on GitHub ↗
(
            selector: string,
            name: Name,
            populate: {label: string; desc: string}[],
            defaultValue: SiteSettings[Name],
            component = Select,
        )

Source from the content-addressed store, hash-verified

324
325 private addSelectors() {
326 const addSelector = <Name extends keyof SiteSettings>(
327 selector: string,
328 name: Name,
329 populate: {label: string; desc: string}[],
330 defaultValue: SiteSettings[Name],
331 component = Select,
332 ) => {
333 const instance = new component(this.root.find(selector), name, populate);
334 this.add(instance, defaultValue);
335 return instance;
336 };
337
338 // We need theme data to populate the colour schemes; We don't add the selector until later
339 const themesData = keys(themes).map((theme: Themes) => {

Callers

nothing calls this directly

Calls 2

addMethod · 0.95
findMethod · 0.80

Tested by

no test coverage detected