Delegate a listener for the blur() event, on document.
This component is predominantly used to record 'blur' events on form elements. However is flexible enough to be customised.
$ component install nib-components/track-event
// fade out | |
function fade(el) { | |
var op = 1; | |
var timer = setInterval(function () { | |
if (op <= 0.1){ | |
clearInterval(timer); | |
el.style.display = 'none'; | |
} | |
el.style.opacity = op; |
#!/bin/sh | |
set -e | |
echo "Warning: You are about to remove all Elm executables!" | |
installdir=/usr/local/bin | |
for bin in elm elm-compiler elm-get elm-reactor elm-repl elm-doc elm-server elm-package elm-make | |
do |
module CountDown where | |
import Graphics.Element exposing (..) | |
import Time exposing (..) | |
import String | |
-- MODEL | |
minutes = 1 | |
seconds = 30 |
/** | |
* get - XHR Request | |
*/ | |
let get = function (url) { | |
return function (callback) { | |
let xhr = new XMLHttpRequest(); | |
xhr.open('GET', url); | |
xhr.onreadystatechange = function() { | |
let response = xhr.responseText; |
import Html exposing (Html, text, div) | |
import Html.App as Html | |
import Mouse exposing (..) | |
main = | |
Html.program | |
{ init = init | |
, view = view | |
, update = update | |
, subscriptions = subscriptions |
import Html exposing (Html, text, div) | |
import Html.App as Html | |
import Keyboard exposing (..) | |
import Char exposing (..) | |
main = | |
Html.program | |
{ init = init | |
, view = view | |
, update = update |
/** | |
* get - XHR Request | |
*/ | |
let get = function (url) { | |
return function (callback) { | |
let xhr = new XMLHttpRequest(); | |
xhr.open('GET', url); | |
xhr.onreadystatechange = function() { | |
let response = xhr.responseText; |
Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !
myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))
let
(a,b,c) = myTuple
module Main exposing (..) | |
import Html exposing (..) | |
depth : number | |
depth = | |
10 | |