Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: improve intellisense for selector subscriptions
currently if you do not provide explicit type in the selector, then the handler function will have `unknown` params. This is because TS does not know which generic type to use for `SelectorReturnValue`. I tried using the `NoInfer` type to prevent the handler function from winning the inference, but unfortunately `NoInfer` does not work with return values. The other option was to switch the handler fn and selector fn around, however this is a destructive change. By making the handler fn use its own generics (which are constrained by the original `SelectorReturnValue`), we effectively defer or ensure that the handler doesn't win the inference.
- Loading branch information