[Discuss] useObserver, utility hooks #97
Description
I'm doing some experimentation/refactoring in light of #38 and #94, and just in general catching up. I have a few places where useComputed works quite well. What I'm starting to think is the pattern of useObserver
as the last return is actually the root of a few problems.
For one, it means you can never do an early return (since a hook is the last return), which is a huge annoyance to me.
Second, using the useObserver
hook as the last return creates a split in the component of unobserved/observed behavior, which I think is just adding complexity.
I've started going back to wrapping components with observer
directly and liking how it feels so far. Under the hood it's still using useObserver
, but it's around the entire component.
Happy to be completely wrong on this or have my mind changed, but is it possible useObserver
is really something that should be more of an internal implementation detail and not exposed to the user?