This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html> | |
| <head> | |
| <title>simple react+redux counter</title> | |
| </head> | |
| <body> | |
| <div id="app"></div> | |
| <script src="bundle.js"></script> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react' | |
| import ReactDOM from 'react-dom' | |
| import { createStore } from 'redux' | |
| const INCREMENT = 'INCREMENT' | |
| const DECREMENT = 'DECREMENT' | |
| const reducer = (state = 0, action) => { | |
| switch (action.type) { | |
| case INCREMENT: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| update action state = | |
| case action of | |
| Increment -> | |
| state + 1 | |
| Decrement -> | |
| state - 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Main exposing (..) | |
| import Html exposing (button, div, span, text) | |
| import Html.Events exposing (onClick) | |
| type Action | |
| = Increment | |
| | Decrement | |
| main = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html> | |
| <head> | |
| <title>my first elm app</title> | |
| </head> | |
| <body> | |
| <div id="app"></div> | |
| <script src="app.js"></script> | |
| <script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Main exposing (..) | |
| import Html exposing (Html, span, text) | |
| import Html.Attributes exposing (class) | |
| main : Html a | |
| main = | |
| span [ class "welcome-message" ] [ text "Hello, World!" ] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fetch = require('isomorphic-fetch') | |
| const R = require('ramda') | |
| const url = 'https://api.github.com/search/repositories?q=+language:javascript' | |
| const listOccurences = names => { | |
| const occurences = {} | |
| names.forEach(name => { | |
| if (name in occurences) { | |
| occurences[name] = occurences[name] + 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fetch = require('isomorphic-fetch') | |
| const async = require('async') | |
| const range = require('ramda').range | |
| const url = 'https://api.github.com/search/repositories?q=+language:javascript' | |
| const listOccurences = names => { | |
| const occurences = {} | |
| names.forEach(name => { | |
| if (name in occurences) { |
NewerOlder