Closed leeoniya closed 1 year ago
mistake?
No, useEffect
that doesn't depend on any inputs can be immediately invoked just once in the outer scope.
is
useUnmount()
identical to the cleanup function returned fromuseEffect()
?
Yes. useEffect()
uses useUnmount()
to add unmount hooks.
feels like a naming inconsistency now?
When I've reduced API surface a couple of days ago, I've made update()
, dirtyCheck()
, etc that used flags
in their arguments as private and just renamed updateRoot()
to update()
. Personally, I don't care how this functions are named and I just didn't want to rename createRoot()
to something like root()
to make it more consistent.
And to make it more consistent with createRoot()
it will be necessary to rename dirtyCheck
, unmount
, hydrate
, update
. I just wanted to keep it simple.
@localvoid
https://github.com/localvoid/ivi/blob/844aa0a7cc7fa87b11f825452f1cec857c5acea6/packages/ivi/README.md?plain=1#L925
mistake?
also, is
useUnmount()
identical to the cleanup function returned fromuseEffect()
?also (unrelated), i see that
updateRoot()
has been renamedupdate()
, but the first arg is still calledroot
. we also havecreateRoot()
. feels like a naming inconsistency now?the README still has
updateRoot(
in its examples