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
// useState(): | |
Note: "However, unlike this.setState in a class, updating a state variable always replaces it instead of merging it." | |
/* before - example 1 */ | |
constructor(props) { | |
super(props); | |
this.state = { | |
count: 0 | |
}; |
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
// mergeDeep({ a: {b: 2} }, { a: { b: 5 }}) | |
// = { a: { b: 5 }} | |
function mergeDeep(obj1, obj2) { | |
let newObj = { ...obj2 }; | |
const recurseObj = (obj1, obj2) => { | |
Object.keys(obj1).forEach(key => { | |
if (typeof obj1[key] === "object" && obj2[key] !== undefined) { |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>CSS Staggered fade up effect</title> | |
</head> | |
<script type="application/javascript"> | |
</script> |
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 { apiRequest, apiError, detectAndroid } from './Utils'; | |
let FrontendComponent = ComposedComponent => { | |
class FrontendClass extends ComposedComponent { | |
constructor() { | |
super(); |
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
var path = require('path'); | |
var webpack = require('webpack'); | |
var ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
var config = { | |
watchOptions: { | |
aggregateTimeout: 300, | |
poll: 1000 | |
}, |
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
class Node { | |
constructor(data) { | |
this.next = null; | |
this.data = data; | |
} | |
} | |
class LinkedList { | |
constructor() { |