Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: createStructuredSelector returns OutputSelector #499

Closed
wants to merge 2 commits into from

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.

@markerikson
Copy link
Contributor

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

@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants