Skip to content

Instantly share code, notes, and snippets.

@mdemin914
mdemin914 / Main.elm
Created January 24, 2017 01:15
example of fetching data with elm and remote data
module Main exposing (..)
import RemoteData exposing (WebData, RemoteData(..), asCmd, fromTask)
import Html exposing (Html, text, div, input, br)
import Html.Events exposing (onClick)
import Html.Attributes exposing (type_, value)
import Http exposing (get, toTask)
import Json.Decode exposing (Decoder, string)
import Json.Decode.Pipeline exposing (decode, required)
import Random exposing (int, generate)
@mdemin914
mdemin914 / Main.elm
Created January 24, 2017 03:18
Composing pages with a nav
module Main exposing (..)
import Html exposing (..)
import Html.Events exposing (onInput, onClick)
-- MODELS
type alias Model =
{
"your_data": "this is my data"
}
function addYourData(user, context, callback) {
user.app_metadata = user.app_metadata || {}
context.idToken['https://pick.some.namespace/your_data'] =
user.app_metadata.your_data
callback(null, user, context)
}