Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This one is a doozy of a PR #85

Closed
wants to merge 21 commits into from
Closed

This one is a doozy of a PR #85

wants to merge 21 commits into from

Conversation

grantholle
Copy link
Contributor

This completely refactors the module and makes a lot of breaking changes (for the better I hope). Definitely a hefty PR.

  • Converts the module to an es6 class
  • Uses promises instead of callbacks
  • Implements Standard.js's rules for code styling
  • General clean up of redundancies
  • Converts endpoints.json to a normal javascript object
  • Remove the browser builds (they look unused/unmaintained)
  • Tests clean up

Looking forward to the discussion 👍

Added standard as a dev dependency and ran the command `standard --fix`, which automatically fixes indentation,
tabs, spacing, equality operators, etc.
Most development is done using build tools such as webpack, so maintaining a build of the package in this form is redundant. It doesn't appear to be maintained much either, so this will make the package a little more leaner
I think this was supposed to be removed since it's in the ignore files, but was still in source control
It seemed pointless to call a script that called a script. It could be called from package.json just as well
Since json gets converted to normal js when you require it, there was really no reason to have it as json other than it's inconvenient to add new stuff to it.
…nd moved to the index file

Sorry this couldn't be more atomic. This is a big one... The module is now an es6 class. Instead of using callbacks, promises are implemented, which will fix #64. Limit.js is also used which was talked about in PR #74. Instead of using the index file to just point to the class in the lib, move the class into the index file. It seemed a little redundant to me.
The timeout had to be increased to accomodate the throttle time (10 seconds)
Some endpoints (like watchlist endpoints) have an optional id parameter. So by default, if there's a session id and the endpoint has an id parameter and none was passed to the function, it will use the default {account_id} as the id parameter. Cleaned up the tests since they all called the same assertions. And added a test for this default id paramter.
If the endpoint has one placeholder and there's a non object argument, assume it's meant for the endpoint
@oriweingart
Copy link

oriweingart commented Nov 30, 2017

Any plans to merge this PR?
Moving into promises will support of async calls easily

@grantholle
Copy link
Contributor Author

Any update on this? If you don't want to merge it (understandable), then I can just make it into a separate package and reference this one

@grantholle
Copy link
Contributor Author

I went ahead and published moviedb-promise.

@grantholle grantholle closed this Dec 19, 2017
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.

None yet

2 participants