MCPcopy Create free account
hub / github.com/codecombat/codecombat / fadeAndStopTrack

Function fadeAndStopTrack

app/core/store/modules/audio.js:653–660  ·  view source on GitHub ↗

* Fades all sounds on a track and stops those sounds after fades are complete * * @param opts {object} * @param opts.fadeOpts {@see fadeTrack} * @param opts.unload {boolean} cleanup sounds after stop * * @return Array of sound IDs that were faded and stopped

({ dispatch }, { unload, ...fadeOpts })

Source from the content-addressed store, hash-verified

651 * @return Array of sound IDs that were faded and stopped
652 */
653 async fadeAndStopTrack ({ dispatch }, { unload, ...fadeOpts }) {
654 const ids = await dispatch('fadeTrack', fadeOpts)
655
656 const stops = ids.map(id => dispatch('stopSound', { id, unload }))
657 await Promise.all(stops)
658
659 return ids
660 },
661
662 /**
663 * Fades a sound and stops it after fades are complete

Callers

nothing calls this directly

Calls 1

dispatchFunction · 0.85

Tested by

no test coverage detected