Re:Making SetInterval Declarative with React Hooks
by underwater on Monday February 04, 2019 @03:35AM
(#19074795)
The pattern of returning an unregister function is a common one. But I agree that the cache key array is strange.
I'd almost suggest that a seperate useEffectOnce function would be better, but I'm sure the abstraction was heavily tested and bikeshedded before it was released in this form.
I'd almost suggest that a seperate useEffectOnce function would be better, but I'm sure the abstraction was heavily tested and bikeshedded before it was released in this form.