Make params optional
See original GitHub issueSome of the methods e.g. get
require params
be given (by using params.sequelize
). This is fine if dealing with an incoming request or via app.service
(I believe) but if using the service directly without going through app
it’ll throw TypeError: Cannot read property 'sequelize' of undefined
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Different ways to make Method Parameter Optional in C# ...
To implement the optional parameter first you need to add System.Runtime.InteropServices namespace in your program, then creates an optional ...
Read more >Named and Optional Arguments - C# Programming Guide
Named arguments enable you to specify an argument for a parameter by matching the argument with its name rather than with its position...
Read more >How can you use optional parameters in C#? - Stack Overflow
In our API wrapper, we detect optional parameters (ParameterInfo p.IsOptional) and set a default value. The goal is to mark parameters as ...
Read more >Using Python Optional Arguments When Defining Functions
In this tutorial, you'll learn about Python optional arguments and how to define functions with default values. You'll also learn how to create...
Read more >How can I declare optional function parameters in JavaScript?
You can make all the parameters optional in JavaScript by not passing any argument to the function call. There are different approaches to ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you for bringing it up. We’ll make sure to mention it in more spots in the documentation to make sure it is well known.
@daffl No worries, thanks for the quick responses. My interpretation was that it was best practice to get it via
app.service
, rather than a necessity. But having said that, and looking back over the docs, the interface of the methods does indicateparams
as a guaranteed parameter, rather than optional like the callback param:get(id, params[, callback])
. As you say though, be great if there is more mention in the docs 😃