port module Decisions.Ports exposing (..) import Decisions.Model exposing (..) import InputTable.Model exposing (..) import Json.Encode as Encode sendRowsJson : List (Row RowData) -> Cmd msg sendRowsJson rows = let rowValues = Encode.list (List.map getRowValue rows) in sendDecisionsRows (Encode.encode 4 rowValues) getRowValue : Row RowData -> Encode.Value getRowValue row = Encode.object [ ( "id", Encode.string row.id ) , ( "checked", Encode.bool row.checked ) ] port sendDecisionsRows : String -> Cmd msg