Skip to content

justExec ​

The justExec() function executes a callback immediately and returns the callback result.

Interactive example ​

Syntax ​

typescript
function justExec<
	GenericOutput extends unknown
>(
	theFunction: () => GenericOutput
): GenericOutput;

Parameters ​

  • theFunction : Callback executed immediately.

Return value ​

The value returned by theFunction.

See also ​

  • justReturn - Builds a constant callback that always returns the same value
  • pipe - Chain transformations and inject justExec in a step

Released under the MIT license.