feat(virtual-core): optimization memo function inner logic
summary
- the condition
opts.key && opts.debug?.()was repeated multiple times, so I assigned it to a variable for reuse. - for the
const depsChanged = ...expression, i extracted it into a separate function instead of assigning it to a variable, to improve readability. - i also replaced the
padfunction withString(...).padStart(...)to prevent unnecessary creation and enhance clarity.
if this PR gets approved, it might be better to move
isDepsChangedto a different file instead ofutils.ts, since all functions inutils.tsare meant to be exported and publicly usable.
⚠️ No Changeset found
Latest commit: abcda379f515d2a0921bb2b1b2bf2e475607d564
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
View your CI Pipeline Execution ↗ for commit abcda379f515d2a0921bb2b1b2bf2e475607d564.
| Command | Status | Duration | Result |
|---|---|---|---|
nx affected --targets=test:sherif,test:knip,tes... |
✅ Succeeded | 2m 29s | View ↗ |
nx run-many --target=build --exclude=examples/** |
✅ Succeeded | 18s | View ↗ |
☁️ Nx Cloud last updated this comment at 2025-04-06 16:06:51 UTC
More templates
- @tanstack/virtual-example-angular-dynamic
- @tanstack/virtual-example-angular-fixed
- @tanstack/virtual-example-angular-infinite-scroll
- @tanstack/virtual-example-angular-padding
- @tanstack/virtual-example-angular-smooth-scroll
- @tanstack/virtual-example-angular-sticky
- @tanstack/virtual-example-angular-table
- @tanstack/virtual-example-angular-variable
- @tanstack/virtual-example-angular-window
- tanstack-lit-virtual-example-dynamic
- tanstack-lit-virtual-example-fixed
- tanstack-react-virtual-example-dynamic
- tanstack-react-virtual-example-fixed
- tanstack-react-virtual-example-infinite-scroll
- tanstack-react-virtual-example-padding
- tanstack-react-virtual-example-scroll-padding
- tanstack-react-virtual-example-smooth-scroll
- tanstack-react-virtual-example-sticky
- tanstack-react-virtual-example-table
- tanstack-react-virtual-example-variable
- tanstack-react-virtual-example-window
- tanstack-svelte-virtual-example-dynamic
- tanstack-svelte-virtual-example-fixed
- tanstack-svelte-virtual-example-infinite-scroll
- tanstack-svelte-virtual-example-smooth-scroll
- tanstack-svelte-virtual-example-sticky
- tanstack-svelte-virtual-example-table
- tanstack-vue-virtual-example-dynamic
- tanstack-vue-virtual-example-fixed
- tanstack-vue-virtual-example-infinite-scroll
- tanstack-vue-virtual-example-padding
- tanstack-vue-virtual-example-scroll-padding
- tanstack-vue-virtual-example-smooth-scroll
- tanstack-vue-virtual-example-sticky
- tanstack-vue-virtual-example-table
- tanstack-vue-virtual-example-variable
@tanstack/angular-virtual
npm i https://pkg.pr.new/@tanstack/angular-virtual@978
@tanstack/lit-virtual
npm i https://pkg.pr.new/@tanstack/lit-virtual@978
@tanstack/react-virtual
npm i https://pkg.pr.new/@tanstack/react-virtual@978
@tanstack/solid-virtual
npm i https://pkg.pr.new/@tanstack/solid-virtual@978
@tanstack/svelte-virtual
npm i https://pkg.pr.new/@tanstack/svelte-virtual@978
@tanstack/virtual-core
npm i https://pkg.pr.new/@tanstack/virtual-core@978
@tanstack/vue-virtual
npm i https://pkg.pr.new/@tanstack/vue-virtual@978
commit: abcda37