From 5e86dca03fbbad6c5fb4df24a5b1a9b257e6e025 Mon Sep 17 00:00:00 2001 From: haad Date: Mon, 29 Feb 2016 13:24:18 +0100 Subject: [PATCH] Ordering tests --- src/list/List.js | 3 ++- src/list/OrbitList.js | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/list/List.js b/src/list/List.js index d2ffa9e..bc1b42a 100644 --- a/src/list/List.js +++ b/src/list/List.js @@ -32,7 +32,8 @@ class List { this.ver = 0; const current = _.differenceWith(this._currentBatch, this._items, Node.equals); const others = _.differenceWith(other.items, this._items, Node.equals); - const final = _.unionWith(others, current, Node.equals); + const final = _.unionWith(current, others, Node.equals); + // const final = _.unionWith(others, current, Node.equals); this._items = this._items.concat(final); this._currentBatch = []; } diff --git a/src/list/OrbitList.js b/src/list/OrbitList.js index 1229127..e98f737 100644 --- a/src/list/OrbitList.js +++ b/src/list/OrbitList.js @@ -30,6 +30,7 @@ class OrbitList extends List { } join(other) { + super.join(other); // WIP: fetch missing nodes let depth = 0; @@ -50,9 +51,8 @@ class OrbitList extends List { } }; - other.items.forEach((e) => e.heads.forEach(fetchRecursive)); - console.log("--> Fetched", MaxHistory, "items from the history\n"); - super.join(other); + // other.items.forEach((e) => e.heads.forEach(fetchRecursive)); + // console.log("--> Fetched", MaxHistory, "items from the history\n"); } clear() {