finom / use-change

The most minimalistic React state management library on the market with zero dependencies and React.useState-like syntax

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

benchmarks?

japrescott opened this issue · comments

I just came by this lib and I think its really nice and offers many possibilities. I would be interested in benchmarks comparing React.context and Redux with this lib. Any intention of adding some?

Good idea!

@japrescott do you have any good performance test so I can easily inject use-change test to make sure that I use proper set up of other libraries to avoid any potential manipulations from my side?

@finom sadly I dont. I would recommend seeing uf redux or reacts useHooks have some benchmarks you can build upon

@japrescott got it. For now take a look at the hook's code: https://github.com/finom/use-change/blob/main/src/useChange.ts#L18-L51 and https://github.com/finom/use-change/blob/main/src/listenChange.ts#L9-L27. It's quite minimalistic and uses a few hooks + Object.defineProperty, which means it should have quite good performance. But a performance demonstration definitely makes sense here.