MCPcopy Create free account
hub / github.com/NianBroken/Firework_Simulator / handleStateChange

Function handleStateChange

js/script.js:455–466  ·  view source on GitHub ↗
(state, prevState)

Source from the content-addressed store, hash-verified

453
454// Perform side effects on state changes
455function handleStateChange(state, prevState) {
456 const canPlaySound = canPlaySoundSelector(state);
457 const canPlaySoundPrev = canPlaySoundSelector(prevState);
458
459 if (canPlaySound !== canPlaySoundPrev) {
460 if (canPlaySound) {
461 soundManager.resumeAll();
462 } else {
463 soundManager.pauseAll();
464 }
465 }
466}
467
468store.subscribe(handleStateChange);
469

Callers

nothing calls this directly

Calls 1

canPlaySoundSelectorFunction · 0.85

Tested by

no test coverage detected