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

Function Toggle

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

Source from the content-addressed store, hash-verified

1444 * @since 4.0.0
1445 */
1446export const Toggle = (options: ToggleOptions): Prompt<boolean> => {
1447 const opts: ToggleOptionsReq = {
1448 initial: false,
1449 active: "on",
1450 inactive: "off",
1451 ...options
1452 }
1453 return Custom(opts.initial, {
1454 render: handleToggleRender(opts),
1455 process: handleToggleProcess,
1456 clear: () => handleToggleClear(opts)
1457 })
1458}
1459
1460const proto = {
1461 ...Effectable.Prototype<Prompt<any>>({

Callers 5

Shared.test.tsFile · 0.50
makeFunction · 0.50

Calls 2

handleToggleRenderFunction · 0.85
CustomFunction · 0.70

Tested by 1

makeFunction · 0.40