Method | Side effects1 | State updates2 | Example uses |
---|---|---|---|
Mounting | |||
componentWillMount |
✓ | Constructor equivalent for createClass |
|
render |
Create and return element(s) | ||
componentDidMount |
✓ | ✓ | DOM manipulations, network requests, etc. |
Updating | |||
componentWillReceiveProps |
✓ | Update state based on changed props |
[user] | |
name = Max Heinz | |
email = [email protected] | |
username = meandmax | |
[core] | |
editor = vim | |
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
excludesfile = ~/.gitignore | |
[web] | |
browser = google-chrome |
const add = (y) => { | |
return (x) => { | |
if (!x) { | |
return y; | |
} | |
return add(y + x); | |
} | |
} |
A curated list by Eric Elliott and friends. Suggest links in the comments below.
This is a very exclusive collection of only must-have JavaScript links. I'm only listing my favorite links. Nothing else makes the cut. Feel free to suggest links if you think they're good enough to make this list. The really curious should feel free to browse the comments to find other links. I can't guarantee the quality of links in the comments.
Some of these links are affiliate links, meaning that if you make a purchase, I might earn a little money. This has absolutely no bearing on whether or not links make the list. None, whatsoever. However, it does allow me more resources to fight poverty with code. Every little bit counts.
New Coffeescript programmers usually struggle with understanding the differences between ->
and =>
function definitions. In order to clarify this common case of confusion, it helps to look at how such functions are compiled down to JavaScript.
class A
constructor: () ->
@funcA()
@funcB()
funcA: () ->
/*! | |
* gulp | |
* $ npm install gulp gulp-rename gulp-replace gulp-browserify gulp-less gulp-csso gulp-uglify gulp-jshint gulp-coffeelint gulp-notify gulp-livereload gulp-sourcemaps gulp-concat coffeeify del jshint-stylish --save-dev | |
*/ | |
var gulp = require('gulp'); | |
var rename = require('gulp-rename'); | |
var replace = require('gulp-replace'); | |
var browserify = require('gulp-browserify'); | |
var less = require('gulp-less'); |
// This doesn`t work, as val is a completly different value then count with own scope | |
var count = 0; | |
var increment = function(val){ | |
val += 1; | |
} | |
increment(count); | |
console.log(count); |
# initializing the parent class with a value defined by the child class | |
class a | |
constructor: (valA = 1, valB = 2, valC = 3, valD = 'parent') -> | |
@func(valD) | |
func: (val) -> | |
console.log(val) | |
class b extends a |