Skip to content

Conversation

@gofreddo
Copy link

allows memoization of circular structures

test('memoize circular JSON', function () {
var circular = {
a: 'foo'
}
circular.b = circular

function circularFunction(a) {
return a.a
}

var memoizedCircularFunction = memoize(circularFunction)

// Assertions

expect(memoizedCircularFunction(circular)).toBe("foo")
expect(memoizedCircularFunction(circular)).toBe("foo")
})

Copy link

@FlorianWendelborn FlorianWendelborn left a comment

Choose a reason for hiding this comment

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

I'm not too familiar with the source, so I unfortunately can't comment on the other changes.

npm-debug.log
.DS_Store
coverage/
.vscode

Choose a reason for hiding this comment

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

Missing newline at EOF. Reasoning

src/index.js Outdated
const cacheDefault = {
create: () => new ObjectWithoutPrototypeCache()
}
}

Choose a reason for hiding this comment

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

EOF

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