Allow variadic dependencies as well as an array
As well as the current system of createSelector([a, b, c], (a, b, c) => ...) it would be great if it would also be possible to do createSelector(a, b, c, (a, b, c) => ...)
This would allow us to implement robust and strictly typed Typescript definitions on createSelector.
Oh, very interesting. The issue is that all the values in the array have to have the same type?
Exactly (or you can specify a union type, but not the order they come in). If they are separate arguments they can be individually typed. This is how Rx gets such good typing in Typescript for functions such as combineLatest.
Ok, thanks. I don't see why we shouldn't do this. @faassen?
@ccapndave @ellbee Sounds interesting to me. I think it has two more advantages:
- it deals with a common mistake that array brackets are ommited.
- ommiting the array brackets makes it imho more readable.
Variadic dependencies added to the 1.0.0 release