Closed wahidshafique closed 2 years ago
Hi, sorry I didn't get a notification. You can add sounds via redux actions as explained here https://github.com/joshwcomeau/redux-sounds#adding-more-sounds-via-actions but you may have to create an empty or dummy initial soundsData
object to initialize the middleware.
@GeKorm So I tried that using redux toolkit and it works, except onend
it fails and gives an error
TypeError
Cannot read properties of undefined (reading '1002')
Howl.onend
https://1mxvw.csb.app/node_modules/redux-sounds/lib/howler_integration.js:2473:33
Howl.eval
https://1mxvw.csb.app/node_modules/howler/dist/howler.js:1886:16
reproduced here: https://codesandbox.io/s/redux-sounds-dynamic-add-bug-1mxvw?file=/src/features/counter/counterSlice.js Just load and then turn on the sound
Thanks for the repro @wahidshafique! Looking into it
@GeKorm Hey thank you so much for the prompt fix, is it possible to roll a release for this, for some reason I cannot get it to work by just pointing to this github repo directly
3.1.1 published! I was just taking my time testing it 😄 Please let me know if you encounter any more problems with this, and thanks again for reporting it.
@GeKorm You unblocked a very crucial part of our release train haha, thanks again man
I want to not have to preload sounds, but rather stream them in/load as the user wishes. Is there any quick way to accomplish that?