From 9549bf3c2b2aa0a4dd344459091c61231551f7c3 Mon Sep 17 00:00:00 2001 From: Josh Ponelat Date: Wed, 21 Jun 2017 15:29:37 +0200 Subject: [PATCH] Add back shallowEqualKeys ( editor depends on it ) --- src/core/utils.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/utils.js b/src/core/utils.js index 27423845..1412c344 100644 --- a/src/core/utils.js +++ b/src/core/utils.js @@ -3,6 +3,7 @@ import Im from "immutable" import camelCase from "lodash/camelCase" import upperFirst from "lodash/upperFirst" import _memoize from "lodash/memoize" +import find from "lodash/find" import some from "lodash/some" import eq from "lodash/eq" import { memoizedSampleFromSchema, memoizedCreateXMLExample } from "core/plugins/samples/fn" @@ -587,3 +588,10 @@ export const filterConfigs = (configs, allowed) => { return filteredConfigs } + +// Is this really required as a helper? Perhaps. TODO: expose the system of presets.apis in docs, so we know what is supported +export const shallowEqualKeys = (a,b, keys) => { + return !!find(keys, (key) => { + return eq(a[key], b[key]) + }) +} -- GitLab