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

Function fadeAll

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

* Fades all tracks between two volumes. * * @param opts {object} * @param opts.from {number|undefined} start volume between 0 and 1 * @param opts.to {number} finish volume between 0 and 1 * @param opts.duration {number} duration of fade in milliseconds * * @return

({ state, dispatch }, { from, to, duration })

Source from the content-addressed store, hash-verified

389 * @return Array of sound IDs that were faded
390 */
391 async fadeAll ({ state, dispatch }, { from, to, duration }) {
392 const fades = Object.keys(state.tracks)
393 .map(track => dispatch('fadeTrack', { track, from, to, duration }))
394
395 const ids = await Promise.all(fades)
396 return ids.flat()
397 },
398
399 /**
400 * Fades a track between two volumes.

Callers

nothing calls this directly

Calls 1

dispatchFunction · 0.85

Tested by

no test coverage detected