Skip to content

Instantly share code, notes, and snippets.

Meiosis Routing with Mithril Router
@foxdonut
foxdonut / index.ios.js
Created November 23, 2016 21:59
Meiosis on React-Native
import React, { Component } from 'react';
import { AppRegistry, Button, StyleSheet, Text, View } from 'react-native';
import { createComponent, run } from "meiosis";
// This is from the React Native hello world example.
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
[ button
[ class "btn btn-primary btn-xs"
, onWithOptions
"click"
{ preventDefault = True, stopPropagation = False }
targetValue
(always (Signal.message address (Save model.todo)))
]
[ text "Save" ]
import Html exposing (Html, button, div, text)
import Html.Events exposing (onClick)
type alias Model = String
type Action
= NoOp
| Show Model
@foxdonut
foxdonut / index.js
Created February 10, 2016 13:38
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var most = require("most");
var h = require("virtual-dom/h");
var diff = require("virtual-dom/diff");
var patch = require("virtual-dom/patch");
var createElement = require("virtual-dom/create-element");
var match = function(query) {
return function(evt) {
@foxdonut
foxdonut / index.js
Last active December 14, 2015 01:11
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var Maybe = require("data.maybe");
var f1 = function(input) {
console.log("f1");
return null;
};
var f2 = function(input) {
console.log("f2");
@foxdonut
foxdonut / README.md
Created November 30, 2015 19:16
Simple React Hello World

Simple React Hello World

Run these commands:

npm i
npm start

You only have to run npm i the first time.

@foxdonut
foxdonut / index.js
Created November 17, 2015 22:26
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var most = require("most");
var h = require("virtual-dom/h");
var diff = require("virtual-dom/diff");
var patch = require("virtual-dom/patch");
var createElement = require("virtual-dom/create-element");
var match = function(query) {
return function(evt) {
[
{
"description": "Buy more beer",
"id": 1,
"priority": 1
},
{
"description": "Order pizza",
"id": 2,
"priority": 1