SolidJSS
SolidJSโ€ข16mo agoโ€ข
5 replies
hcker2000

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

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)
}


right now all im getting when running this is:

RangeError: Invalid array length
Was this page helpful?