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 {findDOMNode} from "react-dom" | |
export default React.createClass({ | |
componentWillMount() { | |
if (process.browser) { | |
this.setState({html: findDOMNode(this).innerHTML}) | |
} | |
}, | |
render() { |
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
/* | |
* <ClientOnly> | |
* <MyStuff /> | |
* </ClientOnly> | |
*/ | |
export default React.createClass({ | |
getInitialState() { | |
return { allowRender: false } | |
}, | |
componentDidMount() { |
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 initial = JSON.parse(app.getAttribute('data-state')) | |
console.log(initial) |
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 he = require("he") | |
const initial = JSON.parse(he.unescape(window.INITIAL_STATE)) | |
console.log(initial) | |
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
// bundlen entry point | |
const he = require("he") | |
const initial = JSON.parse(he.unescape(document.getElementById("state").innerHTML)) | |
console.log(initial) |
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
// require() some stuff from npm (like you were using browserify) | |
// and then hit Run Code to run it on the right |
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 {render} from "react-dom" | |
import Bacon from "baconjs" | |
import {sum} from "lodash" | |
import {atom} from "megablob" | |
import {Combinator} from "megablob/react" | |
function init() { |
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 {range, sum} from "lodash" | |
import combineAsComponent from "./combineAsComponent" | |
import Atom from "./atom" |
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 | |
} |
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() => { |