From 1aaf9e63ecc9c6e132ecdd3af29bff526a2c1e41 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 17 Feb 2017 15:57:48 +0200 Subject: [PATCH] refactor(edit) initConfig: default parameters --- client/edit.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/client/edit.js b/client/edit.js index a3659bf1..1e73fda8 100644 --- a/client/edit.js +++ b/client/edit.js @@ -59,16 +59,13 @@ function EditProto(callback) { throw Error(name + ' should be a function!'); } - function initConfig(config = {}, options) { - Object.assign(config, ConfigView); - - if (!options) - return config; + function initConfig(options = {}) { + const config = Object.assign({}, options, ConfigView); if (options.afterShow) { checkFn('options.afterShow', options.afterShow); - const afterShow = config.afterShow; + const afterShow = {config}; config.afterShow = () => { afterShow();