Skip to content

Commit 2e905e3

Browse files
committed
docs: update readme
1 parent df68dd6 commit 2e905e3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,8 @@ A `snapshot` represents the state of the order book at a specific point in time.
393393
Snapshots are crucial for restoring the order book to a previous state. The orderbook can restore from a snapshot before processing any journal logs, ensuring consistency and accuracy.
394394
After taking the snapshot, you can safely remove all logs preceding the `lastOp` id.
395395

396+
**Note**: The snapshot of the order book returns an object containing an `array` of `bids` and `asks`, which in turn are arrays of order objects. If the snapshot is saved to the database as a `string`, make sure to pass the snapshot in its original format when initializing the order book. For example, you can achieve this by using `JSON.parse` to convert the string back into its original object form.
397+
396398
```js
397399
const ob = new OrderBook({ enableJournaling: true})
398400

0 commit comments

Comments
 (0)