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 { render } from "react-dom"; | |
import Task from "data.task"; | |
import TaskComponent from "./TaskComponent"; | |
const users = [ | |
{ id: 1, name: "User A", points: 45 }, | |
{ id: 2, name: "User B", points: 22 }, | |
{ id: 3, name: "User C", points: 79 }, | |
{ id: 4, name: "User D", points: 54 } |
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"; | |
const NOTASKED = "NOTASKED"; | |
const LOADING = "LOADING"; | |
const SUCCESS = "SUCCESS"; | |
const ERROR = "ERROR"; | |
const cata = (type, data = null) => o => o[type](data); | |
const Data = { |
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
let str = ReasonReact.string; | |
let url = "http://localhost:3000/users"; | |
type user = { | |
id: int, | |
name: string, | |
}; | |
type state = |
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
let str = ReasonReact.string; | |
let url = "http://localhost:3000/users"; | |
type user = { | |
id: int, | |
name: string, | |
}; | |
type state = |
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
let str = ReasonReact.string; | |
let el = ReasonReact.element; | |
let arr = ReasonReact.array; | |
module Dashboard = { | |
let component = ReasonReact.statelessComponent("Dashboard"); | |
let make = _children => { | |
...component, |
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
let str = ReasonReact.string; | |
let el = ReasonReact.element; | |
let arr = ReasonReact.array; | |
module Dashboard = { | |
let component = ReasonReact.statelessComponent("Dashboard"); | |
let make = _children => { | |
...component, |
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
let str = ReasonReact.string; | |
let el = ReasonReact.element; | |
let arr = ReasonReact.array; | |
module Dashboard = { | |
let component = ReasonReact.statelessComponent("Dashboard"); | |
let make = _children => { | |
...component, |
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
type validation('a) = | |
| NotEmpty | |
| Custom('a); | |
type t = string; | |
let validate = (rule, value, values) => | |
switch (rule) { | |
| NotEmpty => String.length(value) > 0 | |
| Custom(fn) => fn(value, values) |
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 { insert, remove, reject } from 'ramda'; | |
// function _insertItem(array, action) { | |
// return [ | |
// ...array.slice(0, action.index), | |
// action.item, | |
// ...array.slice(action.index) | |
// ]; | |
// } | |
const insertItem = (array, action) => insert(action.index, action.item, array); |