kw-args
on components
#1764
harshdoesdev
started this conversation in
Ideas & RFCs
Replies: 1 comment 4 replies
-
@amitu, if a component accepts Example:
or only this should be allowed:
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Continued from this discussion, where we were discussing the implementation of
fastn test helpers
. Some of those helpers allow users to passadditional arguments
that were not explicitly defined on the component.Proposed by @amitu:
The proposal suggests that users should be allowed to pass additional arguments—arguments that are not explicitly defined on the component. Similar to how we handle caption, body, or children, we can instruct the parser to accept these arguments. We can refer to them as
kw-args
.Similar to the caption, the default type for
kw-args
is string. If you want to change the type, you can specify it explicitly:Here,
foo.args
is a hashmap of string to integer.We should allow duplicates and handle them similarly to Django's MultiValueDict.
cc: @Arpita-Jaiswal
Beta Was this translation helpful? Give feedback.
All reactions