Skip to content

Conversation

@stropho
Copy link

@stropho stropho commented Jun 11, 2021

Hi,
unlike createSelector that returns OutputSelector, the createStructuredSelector currently returns a Selector.
What is the difference?
OutputSelector is extended Selector and additionally, it includes:

  resultFunc: C;
  recomputations: () => number;
  resetRecomputations: () => number;

Those are great for testing purposes. These attributes are obviously there, but it is a bit awkward to access them in TS project.
The resultFunc accepts the the input selectors in somewhat unknown order, because Object.keys does not guarantee to return the same values in the same order in all environments. Thus the arguments of resultFunc in this PR are just any. Nonetheless e.g. recomputations are easily accessible.

@stropho stropho force-pushed the outputselector-type branch from cae3a0a to adabb10 Compare June 12, 2021 06:48
@markerikson markerikson added the TypeScript Issues related to TypeScript. label Oct 17, 2021
@markerikson markerikson modified the milestones: 4.1, 5.0 Oct 17, 2021
@markerikson
Copy link
Contributor

Still useful, but the PR is stale vs master, and the latest types are... tricky to say the least.

@stropho stropho force-pushed the outputselector-type branch from adabb10 to 7a5d024 Compare November 4, 2021 13:06
@stropho
Copy link
Author

stropho commented Nov 4, 2021

Thx for the note. I wouldn't notice the change on master after quite a long time :)

aryaemami59 added a commit to aryaemami59/reselect that referenced this pull request Nov 11, 2023
- Add documentation regarding new features.
- Redo `CodeSandbox` examples to align better with documentation. Solves reduxjs#598.
- Fix GitHub workflow badge URL reduxjs#628.
- Add instructions for `bun` and `pnpm`. Solves reduxjs#621.
- Fix minor type issues regarding `createStructuredSelector`. Solves reduxjs#499.
- `argsMemoize` and `argsMemoizeOptions` solve reduxjs#359.
- Remove `Redux` legacy patterns including `connect` and `switch` statements from docs.  Solves reduxjs#515.
- Replace legacy code patterns with modern syntax like `useSelector` and functional components.
- Implementation of `argsMemoize` solves reduxjs#376.
- Document order of execution in `Reselect`. Solves reduxjs#455.
- Add benchmarks to confirm the info inside the documentation.
- Add more type tests with `vitest`.
- Fix more hover preview issues with types.
@aryaemami59 aryaemami59 mentioned this pull request Nov 11, 2023
9 tasks
@markerikson markerikson closed this Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needsRework TypeScript Issues related to TypeScript.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants