To counter this, realm uses uses a hack and offers access to these simple utilities through its
magicSlice rides on the
Our elm code, in
src/frontend/Realm.elm, runs the String.slice with the determining integer when it is passed the type of the
Magic we want to get. The
Magic functions call the
Magic types and then return the values to be used by other code in elm.
Here is the list of Magic functions available to you to use:
getTime : String -> Time.Posix, pass empty string to get time!
warn : String -> a -> a, pass a string and any value that can be converted to string to log it as a warning to console. Useful for debugging.
here : Time.Zone, get timezone offset!
consoleGroupStart : String -> a -> a
consoleGroupEnd : a -> a
log : String -> a -> a, Log a string to console!
crash : String -> StringThrow error in console with string message.
referer : String, get the referer property of the document.
inIFrame : Bool, check whether the page is loaded in within an iFrame or not.
rustfmtFor Some Section