- Hookshot
- Adblock
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
#!/bin/sh | |
matches=$(git diff --cached | grep -E '\+.*?FIXME') | |
if [ "$matches" != "" ] | |
then | |
echo "'FIXME' tag is detected." | |
echo "Please fix it before committing." | |
echo " ${matches}" | |
exit 1 |
This document is a collection of concepts and strategies to make large Elm projects modular and extensible.
We will start by thinking about the structure of signals in our program. Broadly speaking, your application state should live in one big foldp
. You will probably merge
a bunch of input signals into a single stream of updates. This sounds a bit crazy at first, but it is in the same ballpark as Om or Facebook's Flux. There are a couple major benefits to having a centralized home for your application state:
- There is a single source of truth. Traditional approaches force you to write a decent amount of custom and error prone code to synchronize state between many different stateful components. (The state of this widget needs to be synced with the application state, which needs to be synced with some other widget, etc.) By placing all of your state in one location, you eliminate an entire class of bugs in which two components get into inconsistent states. We also think yo
/** | |
* Simple event dispatcher | |
* | |
* Example | |
* | |
* var MyConstructor = function () { | |
* var self = this | |
* var count = 0 | |
* setInterval(function () { | |
* self.emit('tick', {count: count}) |
The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.
However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on
wifi.setmode(wifi.STATION) | |
wifi.sta.config("SSID","password") | |
-- Send POST when buttons A or B pressed | |
PIN_BUTTON_A = 3 -- GPIO0 | |
PIN_BUTTON_B = 4 -- GPIO1 | |
TIME_ALARM = 25 -- 0.025 second, 40 Hz | |
gpio.mode(PIN_BUTTON_A, gpio.INPUT, gpio.PULLUP) |
import Html exposing (..) | |
import Html.App exposing (..) | |
import Html.Attributes exposing (..) | |
import Html.Events exposing (..) | |
import Html.Attributes exposing (..) | |
import Http | |
import Task exposing (Task) | |
import Json.Decode as Json exposing ((:=)) | |
type Msg |
-- See this document for more information on making Pong: | |
-- http://elm-lang.org/blog/pong | |
import Color exposing (..) | |
import Collage exposing (..) | |
import Element exposing (..) | |
import Keyboard | |
import Text | |
import Time exposing (..) | |
import Window exposing (Size) | |
import Html.App as App |
It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.