Skip to main content

io.group

Combines multiple I/O method calls into a single form.

Individual I/O methods await within your action until user input is provided, such that each I/O method call results in a distinct step within the generated internal app. io.group allows you to group multiple I/O methods together to request input all at once in a single step.

caution

io.confirm is not supported within an io.group.

Custom validation can be performed on groups by chaining a .validate() method call to the group. Learn more about validation here.

Usage

const [name, email, age] = await io.group([
io.input.text("Name"),
io.input.email("Email"),
io.input.number("Age"),
]);

Props

Receives an array of I/O method calls as its only argument.

info

Dynamic arrays are supported, but discouraged as they make the result's types not statically determinable and extracting the results difficult to reason about.

Returns

Returns an array of its constituent I/O methods' return values.

Similarly to Promise.all, if the contents are defined inline or of constant types, the return values will be correctly typed by TypeScript.

Was this section useful?
On this page