I hereby claim:
- I am mikaelbr on github.
- I am mikaelb (https://keybase.io/mikaelb) on keybase.
- I have a public key whose fingerprint is A125 51C8 1A5C 7AC1 C71F 3AAC 72CD 8DED 861C D441
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
var component = require('omniscient'); | |
var React = require('react'); | |
var immstruct = require('immstruct'); | |
// With start time | |
var structure = immstruct({ startTime: new Date(), currentTime: new Date() }); | |
var Timer = component(function (props) { | |
// Or swap to have time until. | |
return React.DOM.h1({}, 'MS since start: ' + (props.cursor.get('currentTime') - props.cursor.get('startTime')) ); |
var TestList = React.createClass({ | |
render: function() { | |
var i = 0; | |
var items = this.props.items.map(function(item) { | |
return ( | |
<div key={i++}>{item.name}</div> | |
); | |
}); | |
return ( |
var TestList = React.createClass({ | |
render: function() { | |
var i = 0; | |
var items = this.props.items.map(function(item) { | |
return ( | |
<div key={i++}>{item.name}</div> | |
); | |
}); | |
return ( |
var component = require('omniscient'); | |
var react = require('react'); | |
var immstruct = require('immstruct'); | |
var appStructure = immstruct({ | |
currentUser: { | |
username: void 0 | |
} | |
}); |
function referenceCursor (reference) { | |
return { | |
componentWillMount: function () { | |
reference.onChange(() => this.forceUpdate()); | |
this.reference = reference; | |
} | |
}; | |
} |
IndexedCursorPrototype.onChange = | |
KeyedCursorPrototype.onChange = function(fn) { | |
var original = this._onChange; | |
this._onChange = function () { | |
fn.apply(this, arguments); | |
return original.apply(this, arguments); | |
} | |
return this; | |
}; |
const Tab = Component({item}, {onRemove}) => DOM.div({ | |
className: 'tab' | |
/* ... */ | |
}, [ | |
DOM.button({onClick: onRemove}) | |
]) | |
const TabDeck = Component(items => DOM.div({ | |
className: 'tabs' | |
/* .... */ |
var Benchmark = require('benchmark'); | |
var child_process = require('child_process'); | |
var fs = require('fs'); | |
var colors = require('colors'); | |
var path = require('path'); | |
var Promise = require('bluebird'); | |
var vm = require('vm'); | |
var Immutable = require('immutable'); | |
var immstruct = require('immstruct'); |
var component = require('omniscient'); | |
// If you have to use mixins | |
var withMixin = component.bind({}, [{ | |
componentDidMount: _ => console.log(":D") | |
}]); | |
var ListItem = withMixin(({item}) => <li>{item.deref()}</li>); |