title | author | ||||
---|---|---|---|---|---|
React Patterns in a Post-Hooks World |
|
React is an amazing library and over the last 5 years has transformed the
;; -*- mode: emacs-lisp; lexical-binding: t -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
(defun dotspacemacs/layers () | |
"Layer configuration: | |
This function should only modify configuration layer settings." | |
(setq-default | |
;; Base distribution to use. This is a layer contained in the directory | |
;; `+distribution'. For now available distributions are `spacemacs-base' |
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'VundleVim/Vundle.vim' " required | |
Plugin 'mileszs/ack.vim' |
from operator import itemgetter, eq | |
from functools import partial | |
""" | |
Find dictionary with ID = 2 in a functional way | |
""" | |
records = [{'id': 1}, {'id': 2}, {'id': 3}, {'id': 4}] | |
def compose(*funcs): | |
def h(*args, **kwargs): |
# These are your main API Types | |
type User { | |
id: ID! | |
name: String! | |
email: AWSEmail | |
} | |
type Activity { | |
id: ID! |
#!/usr/bin/env bash | |
set -e | |
IFS='|' | |
help_output () { | |
echo "usage: amplify-push <--environment|-e <name>> <--simple|-s>" | |
echo " --environment The name of the Amplify environment to use" | |
echo " --simple Optional simple flag auto-includes stack info from env cache" | |
exit 1 | |
} |
def fib_n_recur(n): | |
''' Recursive fibonnaci | |
Pro: Matches mathematical definition | |
Con: O(2^n) runtime; n > 40 crazy slow; will blow the stack on large n | |
''' | |
if n == 0: | |
return 0 | |
elif n == 1: |
import React from 'react'; | |
import axios from 'axios'; | |
import { createStore } from 'redux'; | |
// GOAL: | |
// let { useCustomers, ArtemisProvider } = makeDataLayer(schema, axios) | |
// let { customers, signup } = useCustomers('fetch'); | |
const schema = { | |
Customers: { |
import axios from "axios"; | |
// Using `useState()` to manage individual pieces | |
function ComponentWithPlainState({ coursenum }) { | |
let [loading, setLoading] = useState(false); | |
let [data, setData] = useState(); | |
let [errors, setErrors] = useState(); | |
useEffect(() => { | |
setLoading(true); |
title | author | ||||
---|---|---|---|---|---|
React Patterns in a Post-Hooks World |
|
React is an amazing library and over the last 5 years has transformed the
Things that might indicate a problem. RailsConf talk "Get a Whiff of This" by Sandi Metz