mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
update state only if changes
This commit is contained in:
parent
c1e5aa9470
commit
29e3ad5878
@ -22,6 +22,11 @@ export const usePlayerStateContext = (updater) => {
|
||||
function handleStateChange(newState) {
|
||||
newState = deepUnproxy(newState)
|
||||
|
||||
// check if any changes happened
|
||||
if (newState === state) {
|
||||
return
|
||||
}
|
||||
|
||||
setState(newState)
|
||||
|
||||
if (typeof updater === "function") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user