-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lists of Controls? #12
Comments
I think it would depend on what you want to do... for example, do you have specific data that you want the list to start with? or do you just want to create some random data? Do you want the list size to be able to be changed? If so, how does data for the new item get created? |
I have a vector of objects, and it would be nice to
Currently, a record can have fields, but it can't have a field that is a list. I'd love to be able to handle a list. |
Ah yeah, the current Doing something fancier for list controls would need a control for dealing with that, and would also need to figure out how the UI design would work for the general case of lists. With the current package, you could have a |
The main part I can't figure out (even as I have been pouring over the code), is how a nested value gets propogated up after being changed by an event. For example,
How does the onInput event occuring on the |
Essentially the In summary, the way this works is by hiding update functions in closures that are stored within the |
UPDATE: I think I'm getting it... once I've fully understood it, I'll try to add some documentation to the code. So far, one critical part to understanding things is to realize that most of the time in this type signature,
It's hard to write (and, I don't think I have it quite right either yet), so I can see why you'd have a hard time documenting how this works! ORIGINAL QUESTION: For the child
(Side note: why do the But, how does the parent As I look at the code, it is also possible that I don't understand https://github.com/avh4/elm-debug-controls/blob/master/src/Debug/Control.elm#L448 where I'm guessing the magic is occuring in the Also, it's possible that I don't understand what the |
It's similar to how json-decode-pipeline works: If you have record Record
|> field "a" (string "")
|> field "b" (bool False) will have a view for both the string and the bool. If the string control changes, it applies the new string to |
Great project!
https://avh4.github.io/elm-debug-controls/
demonstrates how to create, view, and interact with (click on and change) aUploadRequest
, but how would one create and view aList UploadRequest
? It would be great to be able to have a list of NUploadRequest
s all of which are interactive. That's what I am trying to do with my own model. I have a record like:It's not clear to me from the documentation and code how do to this. I saw that there is a "list" Control, but that doesn't do what I am trying to do, and I haven't been able to figure out exactly how to do it. I'm having a bit of a hard time wrapping my head around exactly how all of this works -- I'm a good developer with functional experience so a lot of it makes sense, but the overall approach is translucent to me currently (though, I can see that it is very cool).
Thank you!
The text was updated successfully, but these errors were encountered: