2module JavaScript.Experimental where
4import JavaScript (JSObject)
5import Native.JavaScript as Native
7-- Turn arbitrary JavaScript objects into Elm records.
8-- Arrays are converted into lists, nested objects are allowed.
9-- No `null` values or non-homogeneous arrays.
12-- { student:"Steve", scores:[83,94,99,72] }
13-- { errorLevel:10, critical:true }
17-- { info:[true,42,'what'] }
18toRecord : JSObject -> a
19toRecord = Native.toRecord
21-- Turn arbitrary Elm records into JavaScript objects.
22-- Lists become arrays, nested records are allowed. No ADTs.
25-- { student="Steve", scores=[83,94,99,72] }
26-- { errorLevel=10, critical=True }
29-- { answer = Nothing }
30-- { result = Left "An error occurred" }
31fromRecord : a -> JSObject
32fromRecord = Native.fromRecord
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list