Node constructor arguments
See original GitHub issuelona.html.Node
takes a list of child elements as *args
.
Div(
child_1,
child_2,
child_3,
id="my-id",
_class="my-class",
)
Here I see two issues:
The first is that all children and attributes have the same indentation. It makes hard to distinguish them.
The second is that I can’t put other attributes (id, style, class, …) before children. For example in dash I can do following (more pretty):
Div(id="my-id", className="my-class", children=[
child_1,
child_2,
child_3,
])
Note: because children
is the first argument in dash
, I can omit its name:
Div([
child_1,
child_2,
child_3,
])
What do you think about change an API (of course it will be a breaking change)?
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Node.js require class with constructor parameter
And it throws an exception, require is not a function , but without a constructor, everything is fine, so the question is how...
Read more >constructor - JavaScript - MDN Web Docs - Mozilla
The constructor method is a special method of a class for creating and initializing an object instance of that class.
Read more >How to pass parameters when instantiating a node
I am a bit confused about how to pass 'constructor' parameters to this Sprite node when instantiating it from inside another scene.
Read more >JavaScript Named Arguments and Class Constructors
JavaScript named arguments can be used in class constructors and normal methods for software robustness.
Read more >Simplify means of constructing JS class with C++ arguments
Get compile-time checking of C++ constructor arguments ... If anything, there may be some node-addon-api helper wrapper to create External<> ...
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
Yes, I think it is a good idea.
@fscherf Great, thanks!