Skip to content

Instantly share code, notes, and snippets.

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 pfftdammitchris/5a71aa9a0f9b6b1f80ce563d79fecdf3 to your computer and use it in GitHub Desktop.
Save pfftdammitchris/5a71aa9a0f9b6b1f80ce563d79fecdf3 to your computer and use it in GitHub Desktop.
function notifySubscribers(...args) {
subscribers.forEach((fn) => fn(...args))
}
function setBackgroundColor(color) {
setState((prevState) => ({
...prevState,
backgroundColor: color,
}))
}
function addProfile(profile) {
setState((prevState) => ({
...prevState,
profiles: prevState.profiles.concat(profile),
}))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment