dai-shi / use-context-selector

React useContextSelector hook in userland
https://www.npmjs.com/package/use-context-selector
MIT License
2.68k stars 61 forks source link

Can you review my hook? (useKeyedContextSelector) #108

Closed casamia918 closed 1 year ago

casamia918 commented 1 year ago

https://github.com/casamia918/example-dropdown-select-use-context-selector

Hi. I've just pushed above repo.

I like this library. But as the "useContextSelector" hook need some setup parameters, I've wrote a simple "useKeyedContextSelector" hook, which the return value is type safed by the given keys.

I want to be reviewed by original hook author. Thanks.

dai-shi commented 1 year ago

I didn't look at the code but isn't it close to https://github.com/dai-shi/react-hooks-global-state ?

casamia918 commented 1 year ago

Nope. It is just a wrapper of "useContextSelector". But it simplifies the usage code.

Um... Maybe, this is not a big deal. I close this issue by myself. Sorry.