Closed goce-cz closed 3 years ago
just a wrapper of the
useImmediateEffect
hook with a special reference.
Well, you're right that this is a very simple wrapper, but its use-case is clearly defined - unlike the one of useImmediateEffect
. The latter hooks is also a bit dangerous, so I think that offering more specific safer variant(s) is not a bad idea.
We can ask other people though: @craig-bishell , @Bartunek , @tomkis , @shkarpa
Purpose
The purpose of this hooks is to allocate resources synchronously while ensuring that those will be properly disposed whenever the dependencies change or the enclosing component gets unmounted.
Usage example