Run these commands:
npm i
npm start
You only have to run npm i
the first time.
Meiosis Routing with Mithril Router |
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', |
test 1 |
[ 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 |
// 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) { |
can.Model({ | |
findAll: function(params) { | |
var dfd = new can.Deferred(); | |
$.get("/abc", params, function(response) { | |
dfd.resolve(response.model); | |
}); | |
return dfd.promise(); | |
} |
function(chain) { | |
return function(req) { | |
doSomethingBefore(req); | |
chain(req); | |
doSomethingAfter(req); | |
}; | |
} |
(fn [chain] | |
(fn [req] | |
(do-something-before req) | |
(chain req) ; continue the chain -- you could potentially not call this to interrupt the chain | |
(do-something-after req))) |