From feb5e30a98d451c89d4e0603c6503cf878f4a9d9 Mon Sep 17 00:00:00 2001 From: Matt Mckenzie Date: Tue, 18 Sep 2018 09:45:40 +0100 Subject: [PATCH 1/2] added get replacement for the soon to be deprecated 'object' --- src/forest-common.jsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/forest-common.jsx b/src/forest-common.jsx index 7533065..303463c 100644 --- a/src/forest-common.jsx +++ b/src/forest-common.jsx @@ -192,6 +192,10 @@ class ForestCommon extends Component { return core.object(this.UID, path, match); } + get(path, match) { + return core.object(this.UID, path, match); + } + notify(){ if(this.mounted) this.setState({}); } From d2662ea7f52bd5bedaea90502e07582fc3d6e796 Mon Sep 17 00:00:00 2001 From: Matt Mckenzie Date: Tue, 18 Sep 2018 10:17:32 +0100 Subject: [PATCH 2/2] added delta logging --- src/forest-core.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/forest-core.js b/src/forest-core.js index f1e119d..da176f7 100644 --- a/src/forest-core.js +++ b/src/forest-core.js @@ -9,6 +9,7 @@ const log = { object: false, net: false, persist: false, + deltas: false, } function listify(...items){ @@ -292,6 +293,7 @@ function updateObject(uid, update){ const changed = !_.isEqual(o,p); const delta = changed && difference(o,p); if (changed) { + if(log.deltas) console.log('deltas:', { uid, delta }); deltas[uid] = (uid in deltas)? Object.assign(deltas[uid], delta): delta; } const notifiable = delta && Object.keys(delta).filter(e=>!notNotifiableProps.includes(e)).length || delta.Timer;