New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trimDeadNodes is pruning my port #241

Closed
bmatcuk opened this Issue May 9, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@bmatcuk

bmatcuk commented May 9, 2015

A while back (I think in Elm 0.13?), I wrote something like this:

port soundUrl : Signal (Maybe String)
stream = updateTrack <~ soundUrl

I have some native javascript that determines a URL based on user input, and then feeds that URL into Elm via soundUrl. updateTrack then takes that and begins streaming the audio (by calling out to an Elm library I was working on to add support for the Web Audio API - so, eventually it ends up in native JS again to create an audio element, set the src, and start playing). stream is never actually used for anything, it's just a placeholder since I can't have updateTrack <~ soundUrl by itself...

This no longer works because trimDeadNodes is removing the signal created by the port from the inputs. When my native JS sets the soundUrl, it's calling notify on the runtime, which is looping through the inputs and firing off the signals, but because trimDeadNodes removed the port earlier, nothing happens... updateTrack is never called.

Is that intended behavior? Have I made a noob mistake? Is there a way to accomplish this that will make trimDeadNodes happy? Or is this a bug?

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz May 11, 2016

Member

No more signals.

Member

evancz commented May 11, 2016

No more signals.

@evancz evancz closed this May 11, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment