How do I cleanup functionality enabled through the play
function?
#23864
Unanswered
lancegliser
asked this question in
Documentation
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The new play function provides a means of interacting with canvas and enables with testing. It might not be a direct requirement of testing to have a cleanup function, but I do end up needing one.
I've got one story that's about continuous animation. Zoom in, Zoom out (based on hover from an external component that controls a prop) on loop to get the feel for timings and demonstration. In order to do that, the most simple implementation is
setInterval
. Mirroring React's handling, I immediately went to return a function the play function could run when it unloaded. It doesn't take one though.How should I cleanup after my play function? Do I need to? Might need to at least expand documentation, if not a minor feature.
Beta Was this translation helpful? Give feedback.
All reactions