troch / reinspect

Use redux devtools to inspect useState and useReducer :mag_right:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Discussion: Make id parameter optional

dharkness opened this issue · comments

I haven't tried this yet, only read the README just now. It seems like omitting id makes the functions operate exactly as the Redux versions. If that's the case, could it be changed to use a default value so we can just change the import to get it working? Do people use multiple id values in their regular apps? Is this so useful that it's required?

Contrast this with how Redux DevTools is integrated in just once place to affect the entire application. Yes, you pepper hooks throughout your code, but having to change the imports and all call sites is a (however small) impediment to using this tool.

I was going to suggest making it the first parameter so we could curry it, but since there are only two functions providing wrappers is still trivial.

I am running into the same issue here which makes it very difficult to track or hook in reinspect.useState to track global hooks.

  • Example Story Here

  • reinspect.useState is injected to use-global-hook here

Upon calling useState reducerId is undefined.

This resolved it for me .

Sweet lib, thanks.