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

Support a promise syntax for requests #12

Merged
merged 7 commits into from
Jun 22, 2014
Merged

Support a promise syntax for requests #12

merged 7 commits into from
Jun 22, 2014

Conversation

kadamwhite
Copy link
Collaborator

This adds provisional support for the syntax flexibility specified on the wiki working document:

// All of these should work
postsQuery.get(function( err, data ) {}); // GET, then trigger a callback fn
postsQuery.then(function( data ) {}, function( err ) {}); // Defaults to GET
postsQuery.get().then(function( data ) {}, function( err ) {}); // Specify GET explicitly

It also begins systematically adding doc block comments using YUIDoc, because I find its documentation easier to use than JSDoc's

@kadamwhite
Copy link
Collaborator Author

Forgot a major change: Renamed all of the module constructor methods to use UpperCamelCase naming conventions, so the taxonomies constructor in taxonomies.js became TaxonomiesQuery, wpQuery became WPRequest, etcetera. Now that I think of it, in all of these we should s/Query/Request/g -- I renamed wpQuery to avoid confusion with WordPress's WP_Query object, and since all of the individual endpoint modules extend WPRequest, they should share the same naming scheme.

This enacts the change I described in #12, to unify the naming of our constructors
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

1 participant