Skip to content

Instantly share code, notes, and snippets.

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 }
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 = {
let str = ReasonReact.string;
let url = "http://localhost:3000/users";
type user = {
id: int,
name: string,
};
type state =
let str = ReasonReact.string;
let url = "http://localhost:3000/users";
type user = {
id: int,
name: string,
};
type state =
let str = ReasonReact.string;
let el = ReasonReact.element;
let arr = ReasonReact.array;
module Dashboard = {
let component = ReasonReact.statelessComponent("Dashboard");
let make = _children => {
...component,
let str = ReasonReact.string;
let el = ReasonReact.element;
let arr = ReasonReact.array;
module Dashboard = {
let component = ReasonReact.statelessComponent("Dashboard");
let make = _children => {
...component,
let str = ReasonReact.string;
let el = ReasonReact.element;
let arr = ReasonReact.array;
module Dashboard = {
let component = ReasonReact.statelessComponent("Dashboard");
let make = _children => {
...component,
@busypeoples
busypeoples / FormExample.re
Created April 23, 2018 00:20
Form Example in ReasonML
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)
@busypeoples
busypeoples / indexUpdates.js
Last active March 23, 2018 00:44
Useful Redux / Ramda functionalities
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);