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

Function pauseTrack

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

* Pauses the specified track. Track must be valid. * Noop when already paused * * @param track {string} name of track to pause * @throws {Error} when invalid track specified

({ state, dispatch }, track)

Source from the content-addressed store, hash-verified

178 * @throws {Error} when invalid track specified
179 */
180 pauseTrack ({ state, dispatch }, track) {
181 const trackData = state.tracks[track]
182 if (!trackData) {
183 throw new Error('Invalid track specified')
184 }
185
186 const pauses = Array.from(trackData.keys())
187 .map(id => dispatch('pauseSound', id))
188
189 return Promise.all(pauses)
190 },
191
192 /**
193 * Stops the specified track and clears current play data. Removes all

Callers

nothing calls this directly

Calls 1

dispatchFunction · 0.85

Tested by

no test coverage detected