-
Notifications
You must be signed in to change notification settings - Fork 672
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
V5 final type changes #639
V5 final type changes #639
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit fda51ea:
|
- Add `@typescript/analyze-trace` to "devDependencies" to help measure TS performance. - Update `.gitignore` file to exclude the trace folder.
- These two types can now be removed since `Selector` and `OutputSelector` support additional parameters by default.
- Add`dependencyRecomputations` and `resetDependencyRecomputations` to enable debugging input selectors and `argsMemoize`. - Slightly refactor `CreateSelectorOptions` for consistency. - Add more type expansions for better visualization for hover-previews. - Slightly modify `ensureIsArray` utility function. - Rename some of the types related to `MergeParameters` for clarity and future maintainability. - Add JSDocs for types related to `MergeParameters`. - Add `dependencyRecomputations` and `resetDependencyRecomputations` to unit tests. - Add type expansions to `createStructuredSelector` to improve visibility during hover-previews. - Add `DefaultMemoizeFields` with `clearCache` in order to centralize definitions.
- Add more units tests for `createStructuredSelector`. - Update JSDocs for: * `createStructuredSelector` * `defaultEqualityCheck` * `CreateSelectorOptions.memoize` * `CreateSelectorOptions.argsMemoize` * `OutputSelectorFields` * `weakMapMemoize` * `autotrackMemoize`
d7a97c0
to
fda51ea
Compare
src/types.ts
Outdated
|
||
/** | ||
* Resets the count of {@linkcode OutputSelectorFields.recomputations recomputations} count to 0. | ||
*/ | ||
resetRecomputations: () => 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✋ Nitpicking a bit. I know these reset methods do return 0
because of the shorthand logic, but conceptually they really oughta be () => void
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you think I should change the implementation to
resetRecomputations: () => {
recomputations = 0
}
This PR includes:
Major changes:
ParametricSelector
andOutputParametricSelector
sinceSelector
andOutputSelector
support additional parameters by default. This is a breaking change!dependencyRecomputations
andresetDependencyRecomputations
to enable debugging input selectors andargsMemoize
.Minor changes:
CreateSelectorOptions
for consistency.ensureIsArray
utility function.MergeParameters
for clarity and future maintainability.MergeParameters
.dependencyRecomputations
andresetDependencyRecomputations
to unit tests.createStructuredSelector
to improve visibility during hover-previews.DefaultMemoizeFields
withclearCache
in order to centralize definitions.createStructuredSelector
.createStructuredSelector
defaultEqualityCheck
CreateSelectorOptions.memoize
CreateSelectorOptions.argsMemoize
OutputSelectorFields
weakMapMemoize
autotrackMemoize