Skip to content

Commit 7e1bb1e

Browse files
committed
wip: skipBaseProperties skip properties that ends with Handler
1 parent eabdc2c commit 7e1bb1e

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

packages/angular-table/src/angularReactivityFeature.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,21 +130,14 @@ export const angularReactivityFeature = constructAngularReactivityFeature()
130130

131131
function skipBaseProperties(property: string): boolean {
132132
return (
133-
// equal `getContext`
133+
// equals `getContext`
134134
property === 'getContext' ||
135135
// start with `_`
136136
property[0] === '_' ||
137-
// start with `get`
137+
// doesn't start with `get`
138138
!(property[0] === 'g' && property[1] === 'e' && property[2] === 't') ||
139139
// ends with `Handler`
140-
(property.length >= 7 &&
141-
property[property.length - 7] === 'H' &&
142-
property[property.length - 6] === 'a' &&
143-
property[property.length - 5] === 'n' &&
144-
property[property.length - 4] === 'd' &&
145-
property[property.length - 3] === 'l' &&
146-
property[property.length - 2] === 'e' &&
147-
property[property.length - 1] === 'r')
140+
property.endsWith('Handler')
148141
)
149142
}
150143

packages/angular-table/tests/benchmarks/injectTable.benchmark.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import { benchCases, columns, createTestTable, dataMap } from './setup'
55
const nIteration = 5
66

77
for (const benchCase of benchCases) {
8-
describe(`injectTable (${benchCase.size} elements)`, () => {
8+
describe(`injectTable - ${benchCase.size} elements`, () => {
99
const data = dataMap[benchCase.size]!
1010

1111
bench(
12-
`${benchCase.size} elements - No reactivity`,
12+
`No reactivity`,
1313
async () => {
1414
const table = createTestTable(false, data, columns)
1515
await setTimeout(0)
@@ -21,7 +21,7 @@ for (const benchCase of benchCases) {
2121
)
2222

2323
bench(
24-
`${benchCase.size} Enabled reactivity`,
24+
`Full reactivity`,
2525
async () => {
2626
const table = createTestTable(true, data, columns)
2727
await setTimeout(0)

0 commit comments

Comments
 (0)