4 ms·
You can certainly compose a `useThing` hook (and others) for more encapsulation and functionality specific to said thing. We actually do this elsewhere as nece
by loh 5y ago
You can certainly compose a `useThing` hook (and others) for more encapsulation and functionality specific to said thing.
We actually do this elsewhere as necessary, like with the top level `Store` component. For the most part, it depends on the situation and how concise/redundant (or not) you want to be. In many cases it actually ends up being more concise overall to simply compose `setState(readThing(id))` as needed, instead of creating a specific method for every possibility.
- strogonoff 5y agoI prefer to generalize logic at another level of abstraction, but to each their own.