useOperation

How to get useOperation

import useOperation from 'fontoxml-fx/src/useOperation.js'

Type: Function

A React hook which allows you to get the context for an operation based on the provided operationName and operationData. Additionally this hook provides you with an executeOperation function.

Arguments

# Name Type Description
1. operationName OperationName

The operationName to retrieve the context for. Defaults to 'do-nothing' if falsy.


  Default value
null
2. operationData OperationData | Null

The operationData to pass to the operation.


  Default value
null
3. [options] Object
  Default value
{
	"focusEditorAfterExecuting": false
}
  Members

Members

Name Type Description
focusEditorAfterExecuting Boolean

Whether or not the editor (content view) should be focused after the operation with the given operationName is executed (using executeOperation as given to the children function of this component). This will not apply for other executions of the operation, outside of this component.


  Default value
false

Returns

Type: UseOperationResult

Was this page helpful?