This repository was archived by the owner on Aug 2, 2025. It is now read-only.

Description
Describe the bug
Adding selectors to a model and then trying to use them, gives unexpected typing.
For example, assuming we have myModel with a total selector, one would expect that selection type of the code below to be (state: any) => {total: number}, but instead it is actually (state: any) => {total: (state: any) => number}.
const selection = store.select((models) => ({
total: models.myModel.totalIds
}));
Reproduce Link
https://codesandbox.io/s/rematch-select-wrong-typing-5tw4w?file=/src/index.ts
To Reproduce
- Go to reproduce link
- Scroll to bottom of
index.ts file
- See the typescript error.
Expected behavior
Selector value should not be a function that expects model state that returns the value.
Screenshots

Desktop
- OS: Win10
- Browser: edge
- Version: 88