Skip to content

Conversation

@NeProgramist
Copy link

No description provided.

Copy link
Member

@tshemsedinov tshemsedinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -0,0 +1,35 @@
'use strict';

const argKey = x => (x.toString() + ':' + typeof(x));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const argKey = x => (x.toString() + ':' + typeof(x));
const argKey = x => (`${x.toString()}:${typeof x}`);

setTimeout(() => f1(2, 4), 9000);
setTimeout(() => f1(2, 4), 12000);
setTimeout(() => f1(2, 4), 22500);
setTimeout(() => f1(2, 4), 23000); No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add empty line at file end

@@ -0,0 +1,49 @@
'use strict';

const argKey = x => (x.toString() + ':' + typeof(x));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -0,0 +1,93 @@
'use strict';

const argKey = x => (x.toString() + ':' + typeof(x));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

const sizeMemoize = (fn, maxSize) => {
const cache = new Map();
const sizeToBytes = (size) => {
if(/[TGMKBtgmkb]/.test(size)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(/[TGMKBtgmkb]/.test(size)) {
if (/[TGMKBtgmkb]/.test(size)) {

@@ -0,0 +1,53 @@
'use strict';

const argKeySync = x => (x.toString() + ':' + typeof(x));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const argKeySync = x => (x.toString() + ':' + typeof(x));
const argKeySync = x => x.toString() + ':' + typeof x;

const syncAsyncMemoize = function(fn) {
const cache = new Map();
return (...args) => {
if (typeof(args[args.length - 1]) === 'function') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (typeof(args[args.length - 1]) === 'function') {
const last = args[args.length - 1];
if (typeof last === 'function') {


const fs = require('fs');

const argKeySync = x => (x.toString() + ':' + typeof(x));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

return countOfArg;
}
};
const memoizeUnity = function(fn) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const memoizeUnity = function(fn) {
const memoizeUnity = fn => {

let cache = new Map();
const events = new Map();
const memoized = (...args) => {
if (typeof(args[args.length - 1]) === 'function') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants