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
Parameter | Type | Description |
---|---|---|
callback | (...args : any []) => void | called after some time. |
actionOptions | CallbackActionOptions | options 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);
})