-
Couldn't load subscription status.
- Fork 25
Description
Right now, if we run:
useFacetEffect(() => { console.log('I will never fire' }, [], [])The effect will never fire, because useFacetEffect expects for all facets to resolve to a value before firing the effect. In this case, there are no facets to resolve in the second dependency array, so it will just never fire at all.
In a way this scenario doesn't make sense (we should use useEffect instead) but since there's no way to enforce that empty arrays are not allowed, we should fail gracefully. Instead of never firing, useFacetEffect with an empty facet array should just behave in exactly the same way as a regular useEffect. This, we think, would be the expected behavior.
This issue applies also to a similar scenario in useFacetCallback. We should fix that one as well in the same way.