Creating Custom Hooks
Hooks provide a way of accessing different points during a Mutate Transaction with the same operations that are available during the Mutuate Transaction itself.
The current hooks available are:
beforeTransaction- Access operations, including the store (via
getStoreoperation), before every provided transaction callback is called
afterTransaction- Access operations after every transaction callback is finished
To create a hook provide a hook function, or async function:
Next, add the hook function on the paper instance under the relevant hook name, for example adding a
beforeTransaction hook from the previous example:
When an array of hook functions are ran they will be run in order, one after the other, waiting for previous async functions or returned promises to resolve.