MCPcopy Create free account
hub / github.com/Effect-TS/effect / toggle

Function toggle

packages/effect/src/unstable/cli/Prompt.ts:1270–1282  ·  view source on GitHub ↗
(options: ToggleOptions)

Source from the content-addressed store, hash-verified

1268 * @since 4.0.0
1269 */
1270export const toggle = (options: ToggleOptions): Prompt<boolean> => {
1271 const opts: ToggleOptionsReq = {
1272 initial: false,
1273 active: "on",
1274 inactive: "off",
1275 ...options
1276 }
1277 return custom(opts.initial, {
1278 render: handleToggleRender(opts),
1279 process: handleToggleProcess,
1280 clear: () => handleToggleClear(opts)
1281 })
1282}
1283
1284const proto = {
1285 ...Effectable.Prototype<Prompt<any>>({

Callers

nothing calls this directly

Calls 2

handleToggleRenderFunction · 0.85
customFunction · 0.70

Tested by

no test coverage detected