Skip to content

gunshi / definition / lazy

Function: lazy()

Define a lazy command with or without definition.

Param

A command loader function that returns a command definition

Param

An optional command definition

Call Signature

ts
function lazy<G>(loader): LazyCommand<G>;

Define a lazy command

Type Parameters

Type ParameterDefault type
G extends GunshiParams<{ args: Args; extensions: { }; }>DefaultGunshiParams

Parameters

ParameterTypeDescription
loaderCommandLoader<G>A command loader

Returns

LazyCommand<G>

A lazy command that can be executed later

Param

A command loader function that returns a command definition

Param

An optional command definition

Call Signature

ts
function lazy<G>(loader, definition): LazyCommand<G>;

Define a lazy command with definition.

Type Parameters

Type ParameterDefault type
G extends GunshiParams<{ args: Args; extensions: { }; }>DefaultGunshiParams

Parameters

ParameterTypeDescription
loaderCommandLoader<G>A command loader function that returns a command definition
definitionCommand<G>An optional command definition

Returns

LazyCommand<G>

A lazy command that can be executed later

Param

A command loader function that returns a command definition

Param

An optional command definition

Released under the MIT License.