This file contains 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
#!/bin/bash | |
node_modules/.bin/nodemon --ignore public/bundle.js & | |
{ { node_modules/.bin/watchify site.js -v -t babelify -g livereactload -o static/bundle.js 1>&2; } 2>&1 \ | |
| while read result; do | |
echo "$result" | |
[[ "$result" =~ ^[0-9]+[[:space:]]bytes[[:space:]]written ]] && node_modules/.bin/livereactload notify | |
done | |
} & |
This file contains 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
var React = require('react'), | |
Router = require('react-router'), | |
lrApi = require('livereactload-api') | |
var { Route, RouteHandler, Link } = Router | |
var App = React.createClass({ | |
contextTypes: { | |
router: React.PropTypes.func |
This file contains 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.exports = { | |
toProperty(initialItems) { | |
const updateItemS = | |
d.stream("item:update") | |
const updateResultS = | |
updateItemS | |
.flatMapLatest(data => Bacon.fromPromise(server.updateItem(data))) | |
.mapError({result: "failure", msg: "Server error"}) |
This file contains 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 Bacon = require("baconjs") | |
Bacon | |
.sequentially(10, [1, 2, 3, 4, 5]) | |
.flatMapFirst(val => Bacon.later(25, val)) | |
.subscribe(console.log.bind(console)) |
This file contains 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
class MyClass | |
foo: -> | |
alert "foobar" | |
bar: -> | |
alert "barfoo" | |
@foo() | |
This file contains 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
class MyClass | |
simple: -> | |
alert "hello!" | |
another: -> | |
alert "hi!" | |
withParams: (a, b) -> | |
alert a + " - " + b | |
withReturnValue: (a) -> | |
return 2 * a |
This file contains 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 {combineAsArray} from "baconjs" | |
import Counter from "./components/counter" | |
import BigList from "./components/bigList" | |
export default initialState => ( | |
combineAsArray(Counter(initialState), BigList()).map( | |
([$counter, $list]) => ( | |
<div> | |
<h1>Tsers!</h1> |
This file contains 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 Bacon from "baconjs" | |
import React from "react" | |
import {cloneAndReplaceProps, isValidElement} from "react/lib/ReactElement" | |
import {find, isEmpty} from "lodash" | |
/** | |
* Transforms: VDOM(Observable) => Observable(VDOM) | |
* Example: | |
* const a = Bacon.constant(4) | |
* const b = Bacon.constant(3) |
This file contains 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 Bacon from "baconjs" | |
import {render} from "react-dom" | |
import liftVDOM from "./liftVDOM" | |
import combineAsComponent from "./combineAsComponent" | |
import Atom from "./atom" | |
function initApp() => { |
This file contains 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 Bacon from "baconjs" | |
import {render} from "react-dom" | |
function Counter(initial) { | |
const incBus = new Bacon.Bus() | |
const value = incBus.map(1).scan(initial, (state, inc) => state + inc) | |
value.inc = () => incBus.push() | |
return value | |
} |
OlderNewer