Delete items from store array issue
I am attempting to remove an array element by one of its objects id properties.
this is my method
right now all im getting when running this is:
this is my method
right now all im getting when running this is:
const removeSound = async (soundId) => {
const audioPlayer = getAudioPlayer(soundId)
const status = getSelectedScene().sounds.find((sound) => sound.id === soundId).status;
// Stop any audio players that are playing for this sound and remove them
if (status == 'playing') {
audioPlayer.stop()
//!= how? delete audioPlayer
}
// Remove the sound from the scene
setSelectedScene('sounds', (sound) => sound.id !== soundId)
}RangeError: Invalid array length