troch / reinspect

Use redux devtools to inspect useState and useReducer :mag_right:
MIT License
424 stars 24 forks source link

Discussion: Make id parameter optional #18

Open dharkness opened 5 years ago

dharkness commented 5 years ago

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.

nmccready commented 5 years ago

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

Upon calling useState reducerId is undefined.

nmccready commented 5 years ago

This resolved it for me .

Sweet lib, thanks.