TNG / ngqp

Declaratively synchronize form controls with the URL
https://tng.github.io/ngqp
MIT License
81 stars 8 forks source link

Improve option typing and remove Unpack<T> #92

Closed Airblader closed 5 years ago

Airblader commented 5 years ago

What's your idea?

To support multi: true, we currently use Unpack<T> for things like serialize. This can cause typing issues in some exotic situations such as when the model is an array but wants to use multi: false as the array should be considered a single value (as I said, exotic).

Describe the solution you'd like

Perhaps we can instead use two different generic arguments which are either <T, T> for multi: false or <T, T[]> for multi: true. Other ideas are also welcome. Note that this is not a finished thought.