port handling for interop between Elm & JS