type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
const { ApolloServer, gql } = require('apollo-server-cloudflare') | |
const { | |
graphqlCloudflare, | |
} = require('apollo-server-cloudflare/dist/cloudflareApollo') | |
const typeDefs = gql` | |
type Query { | |
hello: String | |
} | |
` |
import React from 'react'; | |
const MIN_SCALE = 1; | |
const MAX_SCALE = 4; | |
const SETTLE_RANGE = 0.001; | |
const ADDITIONAL_LIMIT = 0.2; | |
const DOUBLE_TAP_THRESHOLD = 300; | |
const ANIMATION_SPEED = 0.04; | |
const RESET_ANIMATION_SPEED = 0.08; | |
const INITIAL_X = 0; |
type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
--compilers js:./test/support/compiler | |
--require ./test/support/init |
Why would you want to do this? Because you often don't need more. It's nice to not have to think about your "router" as this big special thing.
Instead, with this approch, your app's current pathname
is just another piece of state, just like anything else.
This also means that when doing server-side rendering of a redux app, you can just do:
var app = require('your/redux/app')
var React = require('react')
// ------------ | |
// counterStore.js | |
// ------------ | |
import { | |
INCREMENT_COUNTER, | |
DECREMENT_COUNTER | |
} from '../constants/ActionTypes'; | |
const initialState = { counter: 0 }; |
TLDR: a React component should either manage its own state, or expose a callback so that its parent can. But never both.
Sometimes our first impulse is for a component to entirely manage its own state. Consider this simple theater seating picker that has a letter for a row, and a number for a seat. Clicking the buttons to increment each value is hardly the height of user-interface design, but never mind - that's how it works:
/* @flow */
var React = require('react');
var Letter: React.ReactClass = React.createClass({
getInitialState: function(): any {
'use strict'; | |
import _ from 'lodash'; | |
import i18n from 'i18n'; | |
import {version} from '../../package.json'; | |
registerI18n.attributes = { name: 'i18n', version }; | |
export default registerI18n; |
HOME = . | |
RANDFILE = $ENV::HOME/.rnd | |
oid_section = new_oids | |
[ new_oids ] | |
tsa_policy1 = 1.2.3.4.1 | |
tsa_policy2 = 1.2.3.4.5.6 |