MCPcopy Index your code
hub / github.com/pascalorg/editor / defaultControlValue

Function defaultControlValue

packages/core/src/store/use-interactive.ts:133–144  ·  view source on GitHub ↗
(interactive: Interactive, index: number)

Source from the content-addressed store, hash-verified

131}
132
133const defaultControlValue = (interactive: Interactive, index: number): ControlValue => {
134 const control = interactive.controls[index]
135 if (!control) return false
136 switch (control.kind) {
137 case 'toggle':
138 return control.default ?? false
139 case 'slider':
140 return control.default ?? control.min
141 case 'temperature':
142 return control.default ?? control.min
143 }
144}
145
146export const useInteractive = create<InteractiveStore>((set, get) => ({
147 items: {},

Callers 1

use-interactive.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…