We're learning Elm basics and building a simple application with some audio output with the following setup:
- We are using Elm's StartApp.
- We have ports/audio.js with some POC audio logic (and console.log).
- ATM we are using elm-live to run the application.
With a signal derived from Time.every the port works (code in ports/audio.js is run). In addition, we get "ping" logs with Debug.log.
port audio : Signal Int
port audio =
Signal.map (always 400) (Time.every Time.second)
|> Signal.map (Debug.log "ping")
However, when we use a signal derived from StartApp's App.model, we get a signal (since "ping" logs with Debug.log are logged) but port to JS doesn't work (code in ports/audio.js is not run)?
port audio : Signal Int
port audio =
Signal.map (always 400) signalDerivedFromStartApp
|> Signal.map (Debug.log "ping")
This might be some basic thing related to Elm signals/ports/StartApp?