Skip to content

Commit

Permalink
Optimize functor inheritance
Browse files Browse the repository at this point in the history
PR-URL: #282
  • Loading branch information
tshemsedinov committed Dec 28, 2017
1 parent d62f76e commit 509e8b4
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 20 deletions.
4 changes: 1 addition & 3 deletions lib/collector.functor.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ const collect = (
}
};

Object.assign(collector, methods);

return collector;
return Object.assign(collector, methods);
};

module.exports = {
Expand Down
4 changes: 0 additions & 4 deletions lib/do.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
'use strict';

const util = require('util');

function Do() {}

util.inherits(Do, Function);

const chain = function(fn, ...args) {
const current = (done) => {
if (done) current.done = done;
Expand Down
8 changes: 1 addition & 7 deletions lib/flow.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
'use strict';

const util = require('util');
//const common = require('metarhia-common');

function Flow() {
}

util.inherits(Flow, Function);
function Flow() {}

const flow = (
// Create a composed function from flow syntax
Expand Down
7 changes: 1 addition & 6 deletions lib/memoize.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
'use strict';

const util = require('util');

function Memoized() {
}

util.inherits(Memoized, Function);
function Memoized() {}

const memoize = (
// Create memoized function
Expand Down

0 comments on commit 509e8b4

Please sign in to comment.