(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.
| /* Based on | |
| * - EGM Mathematical Finance class by Enrique Garcia M. <egarcia@egm.co> | |
| * - A Guide to the PMT, FV, IPMT and PPMT Functions by Kevin (aka MWVisa1) | |
| */ | |
| var ExcelFormulas = { | |
| PVIF: function(rate, nper) { | |
| return Math.pow(1 + rate, nper); | |
| }, |
| #!/usr/bin/osascript | |
| # Name of the device as visible in Safari->Develop menu | |
| set deviceName to "iPhone Simulator" | |
| # Number of seconds to wait for the simulator window to show up | |
| set maxWait to 30 | |
| # --------------------------------------- | |
| # You shouldn't modify anything below here |
(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.
It's a common pattern in React to wrap a component in an abstraction. The outer component exposes a simple property to do something that might have more complex implementation details.
We used to have a helper function called transferPropsTo. We no longer support this method. Instead you're expected to use a generic object helper to merge props.
render() {
return Component(Object.assign({}, this.props, { more: 'values' }));In React 0.12, we're making a core change to how React.createClass(...) and JSX works.
If you're using JSX in the typical way for all (and only) React components, then this transition will be seamless. Otherwise there are some minor breaking changes described below.
The Problem
| var copyProperties = require('react/lib/copyProperties'), | |
| Dispatcher = require('flux').Dispatcher, | |
| util = require('util'); | |
| function AppDispatcher() { | |
| Dispatcher.call(this); | |
| this._queue = []; | |
| } | |
| util.inherits(AppDispatcher, Dispatcher); |
In React's terminology, there are five core types that are important to distinguish:
React Elements
| import { Component } from "React"; | |
| export var Enhance = ComposedComponent => class extends Component { | |
| constructor() { | |
| this.state = { data: null }; | |
| } | |
| componentDidMount() { | |
| this.setState({ data: 'Hello' }); | |
| } | |
| render() { |