Created
November 14, 2022 07:29
-
-
Save pfftdammitchris/5a71aa9a0f9b6b1f80ce563d79fecdf3 to your computer and use it in GitHub Desktop.
This file contains 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
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