Open fewkz opened 1 year ago
This is a little complicated to implement, I also don't know what the type of Binding<T>
would even be. It could be something like { getValue: () -> T }
, although I think luau typing is a little finnicky when it comes to function types, so { value: T }
, might be better, but you can't do .value
on a binding, so we'd have to wrap bindings to make that work.
An implementation of this is available in the https://github.com/fewkz/froact/tree/ref-binding branch
What do we want? Fully typed bindings! When do we want it? NOW! Anyways, here's what it would look like:
Beautiful, right? Absolutely glorious and game-changing. Anyways, I figured out how to implement the types, so we'll be seeing it soon(er or later). Instead of doing
you get the luxury of being able to simply do:
Absolutely beautiful, if I do say so myself, and with full luau typing support! Everything is typed, which is not possible with the way Roact bindings are implemented.