Skip to content

Instantly share code, notes, and snippets.

@thysultan
Created December 14, 2018 22:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thysultan/f1cac69271b93393e2ac4245dc5cfdbf to your computer and use it in GitHub Desktop.
Save thysultan/f1cac69271b93393e2ac4245dc5cfdbf to your computer and use it in GitHub Desktop.
// 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