- Check for an existing
.gitignorefile in the project directory
ls -aReact recently introduced an experimental profiler API. This page gives instructions on how to use this API in a production release of your app.
Table of Contents
| import { Component } from "React"; | |
| export var Enhance = ComposedComponent => class extends Component { | |
| constructor() { | |
| this.state = { data: null }; | |
| } | |
| componentDidMount() { | |
| this.setState({ data: 'Hello' }); | |
| } | |
| render() { |
| Mute these words in your settings here: https://twitter.com/settings/muted_keywords | |
| ActivityTweet | |
| generic_activity_highlights | |
| generic_activity_momentsbreaking | |
| RankedOrganicTweet | |
| suggest_activity | |
| suggest_activity_feed | |
| suggest_activity_highlights | |
| suggest_activity_tweet |
| node_modules | |
| package-lock.json |
While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.
JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it much simpler to think about both the old list and the new one, what they contain, and
| #! /usr/bin/env node | |
| # Usage: node create-react-component.js ComponentName | |
| # Note: If a `components` directory does not exist in the current working directory, nothing will be created | |
| const fs = require('fs') | |
| const path = require('path') | |
| const componentName = process.argv[2] | |
| const componentPath = path.join( | |
| 'components', | |
| componentName |
| /** | |
| * Basic proof of concept. | |
| * - Hot reloadable | |
| * - Stateless stores | |
| * - Stores and action creators interoperable with Redux. | |
| */ | |
| import React, { Component } from 'react'; | |
| export default function dispatch(store, atom, action) { |
| ## Puts a big annoying arrow in your window when you're not scrolled down, like a dummy | |
| # | |
| scrollAlert = $("<div id='scrolldown-arrow'>⬇</div>") | |
| showing = false | |
| body = $ document.body | |
| win = $ window | |
| doc = $ document |