Skip to content
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

Support dynamic spreads. #31

Open
back2dos opened this issue Dec 31, 2019 · 1 comment
Open

Support dynamic spreads. #31

back2dos opened this issue Dec 31, 2019 · 1 comment

Comments

@back2dos
Copy link
Member

Especially when working with React passing dynamic props is desired, which is quite different from tink.Anon.merge that underpins hxx spreads. Syntax would be {...untyped <expr>}. Have to figure out what exactly to do regarding type checking. Probably should support a way to disallow it for specific tags (e.g. coconut views).

@kevinresol
Copy link
Member

How about (top-down) typing the attributes without the dynamic spread first. Then just reuse that type for the post-spread object?

function dynamicSpread<T>(staticAttrs:T, dynamicAttrs:Any):T;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants