This file contains hidden or 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
| find . -name "nodemodules" -type d -prune -exec rm -rf '{}' + |
This file contains hidden or 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
| const koa = require('koa'); | |
| const cors = require('kcors'); | |
| const uuid = require('uuid/v1'); | |
| const bodyParser = require('koa-bodyparser'); | |
| const app = new koa(); | |
| let tweets = {}; | |
| app.use(cors()); |
This file contains hidden or 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 { Component } from "React"; | |
| export var Enhance = ComposedComponent => class extends Component { | |
| constructor() { | |
| this.state = { data: null }; | |
| } | |
| componentDidMount() { | |
| this.setState({ data: 'Hello' }); | |
| } | |
| render() { |
This file contains hidden or 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
| const greet = (greeting, name) => { | |
| console.log(`${greeting} ${name}`); | |
| }; | |
| greet("hello", "Adam"); | |
| greet("hello", "Mateusz"); | |
| greet("hi", "Mateusz"); | |
| greet("hi", "Adam"); | |
| const createGreeting = greeting => { |
This file contains hidden or 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"; | |
| const StatelessFunctionalComponent = ({ title }) => { | |
| console.log("StatelessFunctionalComponent"); | |
| return ( | |
| <div> | |
| hello from stateless functional component {title} | |
| </div> | |
| ); | |
| }; |
This file contains hidden or 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
| const posts = [ | |
| {title: 'title 1', id: 1231}, | |
| {title: 'title 2', id: 1232}, | |
| {title: 'title 3', id: 1233}, | |
| {title: 'title 4', id: 1234}, | |
| {title: 'title 5', id: 1235}, | |
| {title: 'title 6', id: 1236}, | |
| {title: 'title 7', id: 1237}, | |
| {title: 'title 8', id: 1238}, | |
| {title: 'title 9', id: 1239}, |
This file contains hidden or 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 ParentComponent extends React.Component { | |
| handleChange(val) { | |
| this.setState({val: val}) | |
| } | |
| render() { | |
| <Select onChange={handleChange} /> | |
| } | |
| } | |
| class Select extends React.Component { |
This file contains hidden or 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 markers = [ | |
| { | |
| score: 9, | |
| count: 145, | |
| homeTeam: "Lawrence Library", | |
| awayTeam: "LUGip", | |
| markerImage: "images/red.png", | |
| information: "Linux users group meets second Wednesday of each month.", | |
| fixture: "Wednesday 7pm" | |
| }, |
This file contains hidden or 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 { pure, withReducer, compose, withHandlers, mapProps } from "recompose"; | |
| import R from "ramda"; | |
| import { createReducer } from "./utils"; | |
| const ListItem = pure(({ text }) => <li>{text}</li>); | |
| const renderItems = R.map(t => <ListItem key={t} text={t} />); | |
| const ListComponent = ({ todos, name, updateName, addTodo }) => | |
| <div> |
This file contains hidden or 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"; | |
| class ListItem extends React.PureComponent { | |
| render() { | |
| return <li>{this.props.children}</li>; | |
| } | |
| } | |
| class List extends React.PureComponent { | |
| constructor(props) { |