Skip to content

Commit

Permalink
Draft
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubwisniewski committed Dec 22, 2023
1 parent 48d9922 commit 55c0884
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions docs/guide/basic-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,11 @@ const hf = HyperFormula.buildFromArray([
['=COUNTBLANK(A1:A3)'],
]);

// Insert an empty row between the row 0 and the row 1
// insert an empty row between the row 0 and the row 1
const changes = hf.addRows(0, [1, 1]);

console.log(hf.getSheetSerialized(0));
// Sheet after adding the row:
// sheet after adding the row:
// [
// [0],
// [],
Expand All @@ -394,7 +394,7 @@ console.log(hf.getSheetSerialized(0));
// ]

console.log(changes);
// Changes include only the COUNTBLANK cell:
// changes include only the COUNTBLANK cell:
// [{
// address: { sheet: 0, row: 4, col: 0 },
// newValue: 1,
Expand Down
16 changes: 8 additions & 8 deletions docs/guide/batch-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@ It allows you to combine multiple data modification actions into a single operat
In some cases, batch operations can result in better performance,
especially when your app requires doing a large number of operations.

::: tip
It's not possible to include read operations in a batch.
Methods such as [`getCellValue`](../api/classes/hyperformula.md#getcellvalue), [`getSheetSerialized`](../api/classes/hyperformula.md#getsheetserialized), or [`getFillRangeData`](../api/classes/hyperformula.md#getfillrangedata) will result in an error when called inside a [batch callback](#using-the-batch-method) or when the evaluation is [suspended](#using-the-suspendevaluation-and-resumeevaluation-methods).


Note: [paste](../api/classes/hyperformula.md#paste) method also cannot be called when batching as it reads the contents of the copied cells.
:::

## How to batch

### Using the [`batch`](../api/classes/hyperformula.md#batch) method
Expand Down Expand Up @@ -121,6 +113,14 @@ Batching can also be useful when you decide to use HyperFormula
on the [server-side](server-side-installation). Several operations
can be sent as a single one.

## What you can't batch

You can't batch read operations.

Methods such as [`getCellValue`](../api/classes/hyperformula.md#getcellvalue), [`getSheetSerialized`](../api/classes/hyperformula.md#getsheetserialized), or [`getFillRangeData`](../api/classes/hyperformula.md#getfillrangedata) will result in an error when called inside a [batch callback](#using-the-batch-method) or when the evaluation is [suspended](#using-the-suspendevaluation-and-resumeevaluation-methods).

The [paste](../api/classes/hyperformula.md#paste) method also can't be called when batching as it reads the contents of the copied cells.

## Demo

<iframe
Expand Down

0 comments on commit 55c0884

Please sign in to comment.