Created
December 14, 2018 22:15
-
-
Save thysultan/f1cac69271b93393e2ac4245dc5cfdbf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// currentTarget is the current value i.e null/node while target is always node | |
function subscribe ({timeout = setTimeout(() => {}), target, currentTarget}, props, state, context) { | |
// when a function is returned it is used when the ref is unmounted. | |
return () => cleartimeout(returnValue) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment