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.
What's your idea?
To support
multi: true
, we currently useUnpack<T>
for things likeserialize
. This can cause typing issues in some exotic situations such as when the model is an array but wants to usemulti: 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>
formulti: false
or<T, T[]>
formulti: true
. Other ideas are also welcome. Note that this is not a finished thought.