@the-sett/elm-browser-info

Gather information on which browser the code is running under.


License
MIT
Install
npm install @the-sett/elm-browser-info@1.0.0

Documentation

Contacts for Support

elm-browser-info

elm-browser-info provides a simple and minimal API for discovering information about the browser code is running under.

Setting up the javascript side and implementing the Elm ports

The javascript code is also available as an npm package. To install the npm package do:

> npm install @the-sett/elm-browser-info

As packages with ports cannot be published, the types of the ports are defined instead. It is up to the user of this package in an application to provide the port implementations.

Add these port definitions to your Elm application:

port module Ports exposing (..)

import BrowserInfo exposing
    ( BrowserInfoResponsePort
    , GetBrowserInfoPort
    )

port getBrowserInfoPort : GetBrowserInfoPort msg


port browserInfoResponsePort : BrowserInfoResponsePort msg