(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
/** | |
* Functional is always better. Keep it simple, just proxy them to classes if you need | |
* Classes sucks. Try to avoid them. | |
* Always give a way to use something "class specific" to others | |
* => don't make it class specific in the first place | |
* / | |
function Foo(x) { | |
this.x = x; | |
} |
var React = require('react'); | |
var Grandparent = React.createClass({ | |
childContextTypes: { | |
foo: React.PropTypes.string.isRequired | |
}, | |
getChildContext: function() { | |
return { | |
foo: this.props.foo |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
const printOptions = { | |
quote: 'single', | |
trailingComma: true, | |
}; | |
const SHOULD = 'should'; | |
module.exports = function transform(file, api) { | |
const source = file.source; |
const _ = require('underscore'); | |
const printOptions = { | |
quote: 'single', | |
trailingComma: true, | |
}; | |
const mochaFunctions = [ | |
'describe', | |
'it', |
const path = require('path'); | |
const printOptions = { | |
quote: 'single', | |
trailingComma: true, | |
}; | |
const I18N_MIXIN = 'i18nMixin'; | |
const I18N_MIXIN_FILE = 'mixins/i18n'; | |
const CONNECT_TO_I18N = 'connectToI18n'; |
const log = (scope, item) => () => console.log(`${item} of ${scope}`); | |
const dummy = () => {}; | |
describe('Outer scope', function() { | |
before(log(this.title, 'before')); | |
beforeEach(log(this.title, 'beforeEach')); | |
afterEach(log(this.title, 'afterEach')); |
#!/bin/bash | |
apt-get update | |
apt-get install bind9 | |
cat <<EOF > /etc/bind/named.conf.options | |
options { | |
directory "/var/cache/bind"; | |
forwarders { | |
8.8.8.8; | |
8.8.4.4; |
const set = [0, 1, 2]; | |
const retry = n => stream => stream.recoverWith(e => n === 0 ? most.throwError(e) : retry(n - 1, stream)); | |
let i = 0; | |
most.from(set) | |
.tap(x => { | |
if (i === 0 && x === 2) | |
{ | |
i++; |
import { just, iterate } from 'most'; | |
const inputString = 'initial'; | |
just(inputString) | |
.tap(x => console.log(`my initial string ${x}`)) | |
.chain(() => iterate(x => x + 1, 1)) | |
.tap(x => console.log(`generated chapter url ${x}`)) | |
.take(4) // If I remove this line, I get the requests starting, but then I get stuck in an infinite loop of generated chapters url | |
.map(x => { |