MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / bindSelect

Function bindSelect

packages/core/src/forms/bind.ts:136–147  ·  view source on GitHub ↗
(
  state: S,
  field: K | string,
  update: Updater<S>,
)

Source from the content-addressed store, hash-verified

134}
135
136export function bindSelect<S extends Record<string, unknown>, K extends keyof S>(
137 state: S,
138 field: K | string,
139 update: Updater<S>,
140): Pick<SelectProps, "value" | "onChange"> {
141 return {
142 value: toInputValue(getFieldValue(state, field)),
143 onChange: (value: string) => {
144 update((prev) => setField(prev, field, value));
145 },
146 };
147}

Callers 1

form.bind.test.tsFile · 0.85

Calls 4

getFieldValueFunction · 0.85
setFieldFunction · 0.85
toInputValueFunction · 0.70
updateFunction · 0.50

Tested by

no test coverage detected