-
- An Introduction: Composing Software: An Introduction – JavaScript Scene – Medium
-
- The Rise and Fall of Functional Programming: The Rise and Fall and Rise of Functional Programming (Composing Software)
-
- Why Learn Functional Programming in JavaScript?: Why Learn Functional Programming in JavaScript? (Composing Software)
-
- A Functional Programmer’s Introduction to JavScript: A Functional Programmer’s Introduction to JavaScript (Composing Software)
-
- Higher Order Functions: [Higher Order Functions (Compos
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
// Future versions of Hyper may add additional config options, | |
// which will not automatically be merged into this file. | |
// See https://hyper.is#cfg for all currently supported options. | |
module.exports = { | |
config: { | |
visor: { | |
hotkey: 'Control+`', | |
position: 'right', // or left, right, bottom | |
width: 900, // Optional, defaults to half of viewable area for horizontal positions, 100% for vertical |
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, { Component } from 'react'; | |
import SearchResult from './SearchResult.js'; | |
import url from '../../config'; | |
import axios from 'axios'; | |
class Search extends Component { | |
constructor() { | |
super(); | |
this.state = { | |
filter: 'SUBJECT', |
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, { Component } from 'react'; | |
import axios from 'axios'; | |
import url from '../../config'; | |
import './SearchResult.css'; | |
class SearchResult extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
upVote: this.props.results.VOTES.UP, |
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
// The for loop performs much faster | |
function nFactorial (num) { | |
let factorial = 1; | |
for (let i = 1; i <= num; i++) { | |
factorial *= i; | |
} | |
return factorial; | |
} | |
// Recursion is about 11× slower |
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, { Component } from 'react' | |
import { connect } from 'react-redux' | |
import { FormControl, FormGroup } from 'react-bootstrap' | |
import { register } from '../Actions' | |
class SignUp extends Component { | |
constructor() { | |
super() | |
this.state = { |
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, { Component } from 'react' | |
import { connect } from 'react-redux' | |
import { FormControl, FormGroup } from 'react-bootstrap' | |
import { Link } from 'react-router-dom' | |
import { login } from '../Actions' | |
class SignIn extends Component { | |
constructor(props) { | |
super(props) |
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
// Good ol' ternary | |
<div>{condition ? <span /> : null}</div> | |
// AND | |
<div>{condition && <span />}</div> | |
// Multiple elements | |
<div>{condition ? [<span />, <span />] : null}</div> |
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
// === Arrays | |
var [a, b] = [1, 2]; | |
console.log(a, b); | |
//=> 1 2 | |
// Use from functions, only select from pattern | |
var foo = () => [1, 2, 3]; |
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, { Component } from 'react' | |
import { withRouter } from 'react-router-dom' | |
class ContactForm extends Component { | |
submitForm = (e) => { | |
e.preventDefault() | |
this.props.history.push('/thank-you') | |
} | |
render() { |
OlderNewer