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

.list() optional parameters #78

Closed
tcf909 opened this issue Feb 4, 2016 · 3 comments
Closed

.list() optional parameters #78

tcf909 opened this issue Feb 4, 2016 · 3 comments

Comments

@tcf909
Copy link
Contributor

tcf909 commented Feb 4, 2016

It appears that the code doesn't support the optional parameter as 'optional' when using a callback...

Need to shift the callback function given to the callback variable in the method if no parameter is given.

In JS I usually use something like:

//Handle options arguments
if( _.isUndefined(cb) )
if( _.isFunction(param) )
( param = options ) && ( param = undefined );

Not sure what you would do with that in CoffeeScript.

To reproduce:

var tableList = dynamo.list(function( err, test){

console.log('test');

});

and you will see the callback is never called.

@tcf909
Copy link
Contributor Author

tcf909 commented Feb 4, 2016

Actually, after looking at the code, the issue is:

if (params == !null) {

needs to be more like:

if (params !== null) {

and probably:

if ( ! _.isNil(params) ){

@tcf909
Copy link
Contributor Author

tcf909 commented Feb 4, 2016

filed issue #79 to resolve

@victorquinn
Copy link
Owner

Looks like this was fixed with #79 closing

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

No branches or pull requests

2 participants