Skip to content

[Feature Request] Need a onCancel property #54

Description

@AkaraChen

Is your feature request related to a problem? Please describe.

I think have a onCancel property will be better.

Currently I need to call isCanceled in every prompts, I think it is troublesome.

Describe the solution you'd like

import { text, cancel } from '@clack/prompts'

const result = await text({
	/* Other options */
	onCancel() {
		cancel('Operation canceled.')
		process.exit(1)
	}
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions