Can we get auto-completion for $set method?
See original GitHub issuePretty much like how we get the current auto complete when using .where()
method.
Currently, we get nothing.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
java - Autocomplete in eclipse skipping getters and setters
No, there's no functionality like that in Eclipse, as far as I know. However, Eclipse does support CamelCase searches in most places, ...
Read more >HTML attribute: autocomplete - MDN Web Docs
The HTML autocomplete attribute lets web developers specify what if any permission the user agent has to provide automated assistance in ...
Read more >IntelliSense in Visual Studio Code
If you continue typing characters, the list of members (variables, methods, etc.) is filtered to only include members containing your typed characters.
Read more >Auto-completion - Notepad++ User Manual
You can use arrow keys (or the mouse) to navigate through the entries in the popup; hitting the completion key or double-clicking on...
Read more >Place Autocomplete | Places API - Google Developers
This section describes best practices to help you make the most of the Place Autocomplete service. Here are some general guidelines: The quickest...
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 Free
Top 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
There’s no intended way of setting properties. You can do it however you want. The $set method works, you just don’t get auto completion currently. We could in theory define the
$set
method like thisWhere
PartialModelObject
is likePartial
, but it also removes methods. But that would only allow a subset of the defined properties to be set. Objection allows you to set any properties for historical reasons.Objection was developed without typescript, and adding typescript typings afterwards like this is always a compromise, and some things don’t work so well.
You can easily create your own helper like:
And then just inherit your models from
BaseModel
instead ofModel
.Nice, this works great for our use case, thanks!