tink_hxx icon indicating copy to clipboard operation
tink_hxx copied to clipboard

Support dynamic spreads.

Open back2dos opened this issue 5 years ago • 1 comments

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).

back2dos avatar Dec 31 '19 15:12 back2dos

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;

kevinresol avatar May 19 '20 06:05 kevinresol