Skip to content
This repository has been archived by the owner on Sep 24, 2021. It is now read-only.

Pass single props to components #8

Open
kaleidawave opened this issue Oct 8, 2020 · 0 comments
Open

Pass single props to components #8

kaleidawave opened this issue Oct 8, 2020 · 0 comments
Assignees
Labels
client-side-reactivity Reflection of updates to state on the view enhancement New feature or request

Comments

@kaleidawave
Copy link
Owner

Currently to send data to a object the only supported method is through sending a whole already existing object to a component:

<SomeComponent $data="someObj"></SomeComponent>

This works fine through csr, ssr and cssu (client side state updates).

It would be nice if rather than having to send a whole object that it could be constructed from state:

<SomeComponent $data="{someProp: x}"></SomeComponent>
<SomeComponent $data="{...someObj, someProp: x}"></SomeComponent>

This should currently work with csr and ssr. It just takes a few additions to the set and get compiler logic to work. But there may be some nuances with reference types...?

There is then the opportunity to add more intuitive syntax for this:

<SomeComponent $data-someProp="x"></SomeComponent>
<!-- To be desugared to: -->
<SomeComponent $data="{someProp: x}"></SomeComponent>
@kaleidawave kaleidawave added enhancement New feature or request client-side-reactivity Reflection of updates to state on the view labels Oct 8, 2020
@kaleidawave kaleidawave self-assigned this Oct 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
client-side-reactivity Reflection of updates to state on the view enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant