kw-args
on components (kwargs)
#1764
Replies: 3 comments 5 replies
-
@amitu, if a component accepts Example:
or only this should be allowed:
|
Beta Was this translation helpful? Give feedback.
-
I like explicit contracts more than this, a component/function should be able to specify exactly what it needs (we have typing in
Please give more examples where you think |
Beta Was this translation helpful? Give feedback.
-
@siddhantk232 I have implemented
Is producing: curl http://127.0.0.1:8000/-/auth/config/
{"sign-up-url":{"String":{"text":"$lets-talk.sign-up-url"}}} I am working on fixing the base
What is the type of Things are a bit hazy still tho, But then we should look at use cases, and I feel so far the only use case that makes sense (for |
Beta Was this translation helpful? Give feedback.
-
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