question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make params optional

See original GitHub issue

Some 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:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dafflcommented, Aug 17, 2016

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.

0reactions
bedeoverendcommented, Aug 18, 2016

@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 indicate params 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 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found