From 77f6e295aed32410cf6f8b9bd943215ef24ea5b9 Mon Sep 17 00:00:00 2001 From: Xing Yun Date: Sat, 24 Mar 2018 13:30:08 -0400 Subject: [PATCH 1/3] factory --- src/layer/factory.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/layer/factory.js diff --git a/src/layer/factory.js b/src/layer/factory.js new file mode 100644 index 0000000..c96a671 --- /dev/null +++ b/src/layer/factory.js @@ -0,0 +1,10 @@ +const compose = (baseLayer, fns) => + fns.reduce((acc, cur) => { + acc = Object.assign(acc, cur(acc)); + return acc; + }, baseLayer); + +const factory = (baseLayer, composers, apis) => (id, opt) => + compose(baseLayer(id, opt, composers), apis); + +export default factory; From ed71230d57b5007b750f9c460e2875e89a27da72 Mon Sep 17 00:00:00 2001 From: Xing Yun Date: Sat, 24 Mar 2018 13:32:12 -0400 Subject: [PATCH 2/3] expose factory --- src/layer/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/layer/index.js b/src/layer/index.js index 78093bf..58e45b6 100644 --- a/src/layer/index.js +++ b/src/layer/index.js @@ -1,4 +1,5 @@ export { default as svgLayer } from './svgLayer'; export { default as canvasLayer } from './canvasLayer'; export { default as Globals } from './Globals'; +export { default as factory } from './factory'; export * from './compose'; From 37b47fe9412fcf7bf08109dd5114945d8a2eceb4 Mon Sep 17 00:00:00 2001 From: Xing Yun Date: Sat, 24 Mar 2018 13:34:16 -0400 Subject: [PATCH 3/3] bump to 2.0.0-rc.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d401734..85983b8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vizart-core", - "version": "2.0.0-rc.1", + "version": "2.0.0-rc.2", "description": "Core Components for VizArt", "main": "dist/vizart-core.js", "module": "dist/vizart-core.mjs",