@@ -8,7 +8,7 @@ import { useRegistrar } from './index'
8
8
9
9
describe ( 'useRegistrar benchmarks' , ( ) => {
10
10
it ( 'should benchmark registration operations' , async ( ) => {
11
- const [ , _provideContext , context ] = useRegistrar ( 'benchmark-test' )
11
+ const context = useRegistrar ( 'benchmark-test' ) [ 2 ]
12
12
13
13
const result = await run ( 'register 1000 items' , ( ) => {
14
14
for ( let i = 0 ; i < 1000 ; i ++ ) {
@@ -24,7 +24,7 @@ describe('useRegistrar benchmarks', () => {
24
24
} )
25
25
26
26
it ( 'should benchmark lookup operations' , async ( ) => {
27
- const [ , _provideContext , context ] = useRegistrar ( 'benchmark-test' )
27
+ const context = useRegistrar ( 'benchmark-test' ) [ 2 ]
28
28
29
29
// Pre-populate with items
30
30
for ( let i = 0 ; i < 1000 ; i ++ ) {
@@ -45,7 +45,7 @@ describe('useRegistrar benchmarks', () => {
45
45
} )
46
46
47
47
it ( 'should benchmark unregistration operations' , async ( ) => {
48
- const [ , _provideContext , context ] = useRegistrar ( 'benchmark-test' )
48
+ const context = useRegistrar ( 'benchmark-test' ) [ 2 ]
49
49
50
50
// Pre-populate with items
51
51
const items : { id : string , index : number } [ ] = [ ]
@@ -68,7 +68,7 @@ describe('useRegistrar benchmarks', () => {
68
68
} )
69
69
70
70
it ( 'should benchmark reindexing operations' , async ( ) => {
71
- const [ , _provideContext , context ] = useRegistrar ( 'benchmark-test' )
71
+ const context = useRegistrar ( 'benchmark-test' ) [ 2 ]
72
72
73
73
// Pre-populate with items
74
74
for ( let i = 0 ; i < 1000 ; i ++ ) {
@@ -87,7 +87,7 @@ describe('useRegistrar benchmarks', () => {
87
87
} )
88
88
89
89
it ( 'should compare different operation types' , async ( ) => {
90
- const [ , _provideContext , context ] = useRegistrar ( 'benchmark-test' )
90
+ const context = useRegistrar ( 'benchmark-test' ) [ 2 ]
91
91
92
92
// Pre-populate for lookup and unregister tests
93
93
const items : { id : string , index : number } [ ] = [ ]
@@ -98,7 +98,7 @@ describe('useRegistrar benchmarks', () => {
98
98
99
99
const results = await compare ( {
100
100
'register 100 items' : ( ) => {
101
- const [ , _provideContext , ctx ] = useRegistrar ( 'register-test' )
101
+ const ctx = useRegistrar ( 'register-test' ) [ 2 ]
102
102
for ( let i = 0 ; i < 100 ; i ++ ) {
103
103
ctx . register ( { id : `item-${ i } ` } )
104
104
}
@@ -128,7 +128,7 @@ describe('useRegistrar benchmarks', () => {
128
128
console . log ( 'Registration performance by collection size:' )
129
129
130
130
for ( const size of sizes ) {
131
- const [ , _provideContext , context ] = useRegistrar ( `benchmark-size-${ size } ` )
131
+ const context = useRegistrar ( `benchmark-size-${ size } ` ) [ 2 ]
132
132
133
133
const result = await run ( `register ${ size } items` , ( ) => {
134
134
for ( let i = 0 ; i < size ; i ++ ) {
0 commit comments