From 4e3c30650e01856cd12ec8f35d8e5fc52b541470 Mon Sep 17 00:00:00 2001 From: anders Date: Mon, 30 Mar 2020 23:58:13 -0500 Subject: [PATCH] improve readability --- src/Store.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Store.js b/src/Store.js index b3b7a8a..6eb8978 100644 --- a/src/Store.js +++ b/src/Store.js @@ -486,7 +486,7 @@ class Store { } async _addOperation (data, { onProgressCallback, pin = false } = {}) { - return this._opqueue.add(async () => { + async function addOperation () { if (this._oplog) { // check local cache? if (this.options.syncLocal) { @@ -501,7 +501,8 @@ class Store { if (onProgressCallback) onProgressCallback(entry) return entry.hash } - }) + } + return this._opqueue.add(addOperation.bind(this)) } _addOperationBatch (data, batchOperation, lastOperation, onProgressCallback) {