* 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)
| 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 |
nothing calls this directly
no test coverage detected