Skip to content

Commit

Permalink
Merge branch 'release/2.0.0-rc.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
BigFatDog committed Mar 24, 2018
2 parents 907433b + 37b47fe commit ca6b0af
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
10 changes: 10 additions & 0 deletions src/layer/factory.js
Original file line number Diff line number Diff line change
@@ -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;
1 change: 1 addition & 0 deletions src/layer/index.js
Original file line number Diff line number Diff line change
@@ -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';

0 comments on commit ca6b0af

Please sign in to comment.