Skip to main content

Function: clusterAction()

function clusterAction(callback: (...args: any[]) => void, actionOptions: CallbackActionOptions): void

Starts an action after a period of time giving the user an opportunity to cancel the action.

Parameters

ParameterTypeDescription
callback(...args: any[]) => voidcalled after some time.
actionOptionsCallbackActionOptionsoptions for text messages and callbacks.

Returns

void

Example

  clusterAction(() => runFunc(clusterName), {
startMessage: `About to "${command}" cluster "${clusterName}"…`,
cancelledMessage: `Cancelled "${command}" cluster "${clusterName}".`,
successMessage: `Cluster "${command}" of "${clusterName}" begun.`,
errorMessage: `Failed to "${command}" ${clusterName}.`,
cancelCallback: () => {
setActing(false);
setRunning(false);
handleClose();
setOpenDialog(false);
})

Defined in

src/plugin/registry.tsx:905