Skip to content

Instantly share code, notes, and snippets.

View baritonehands's full-sized avatar

Brian Gregg baritonehands

  • Centro
  • Chicago, IL
View GitHub Profile
module Select exposing (select)
import Dict exposing (Dict)
import Html exposing (Html, Attribute, text)
import Html.Attributes exposing (value)
import Html.Events exposing (on, targetValue)
import Json.Decode as Json
toDict : List ( a, String ) -> Dict String ( a, String )
(defprotocol CRUD
(create [this entity])
(get [this id])
(save [this id updates])
(delete [this id]))
(defn create-db []
(let [db (ref {})]
(reify CRUD
(create [_ entity]