Skip to content

Optional update parameter + user/item namespace#41

Open
gabriel-alecu wants to merge 12 commits intoguymorita:masterfrom
gabriel-alecu:master
Open

Optional update parameter + user/item namespace#41
gabriel-alecu wants to merge 12 commits intoguymorita:masterfrom
gabriel-alecu:master

Conversation

@gabriel-alecu
Copy link
Copy Markdown

I added an optional parameter to liked/disliked, so you can add multiple ratings without having to re-calculate the user recommendations every time:

raccoon.liked(userId, itemId, [update = true], callback);
raccoon.disliked(userId, itemId, [update = true], callback);

Manual updates with:
raccoon.updateUser(userId, callback);
and
raccoon.updateItem(itemId, callback);

Also, added separate namespaces for users & items (#42)

And I got tired of seeing so many failed Travis builds, so I tried to fix that.
But I had to give up on mochacov:coverage. Couldn't find a quick fix, and I don't have any experience with it.

In order to avoid conflicts
@gabriel-alecu gabriel-alecu changed the title Optional update parameter + install/test fixes Optional update parameter + install/test fixes + user/item namespace Mar 27, 2016
Especially when user data updates are disabled
@gabriel-alecu gabriel-alecu changed the title Optional update parameter + install/test fixes + user/item namespace Optional update parameter + user/item namespac Apr 7, 2016
@gabriel-alecu gabriel-alecu changed the title Optional update parameter + user/item namespac Optional update parameter + user/item namespace Apr 7, 2016
@guymorita guymorita force-pushed the master branch 4 times, most recently from 2fddc96 to 3709adb Compare January 3, 2017 17:45
Comment thread lib/input.js
//make the update parameter optional while still allowing the callback to be last (for readability)
if (typeof update == 'function') {
callback = update;
update = true;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why not make use of ES6's default parameters?

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