Skip to content

Instantly share code, notes, and snippets.

View brygrill's full-sized avatar

Bryan Grill brygrill

View GitHub Profile
const App = () => {
// state
const [authed, setAuthed] = useState(false);
const [token, setToken] = useState(null);
const [user, setUser] = useState(null);
// functions
const removeHash = () => {
window.history.pushState('', document.title, window.location.pathname);
};
import axios from 'axios';
const userItemsBase = 'https://www.arcgis.com/sharing/rest/content/users';
export const fetchUserContent = async (token, username) => {
const { data } = await axios.get(`${userItemsBase}/${username}`, {
params: {
token,
f: 'json',
},
@brygrill
brygrill / eslintrc.js
Last active April 2, 2021 16:07
ESLint config with TypeScript, AirBnb, Jest, and Prettier
module.exports = {
extends: [
'airbnb-typescript',
'airbnb/hooks',
'plugin:@typescript-eslint/recommended',
'plugin:jest/recommended',
'plugin:prettier/recommended'
],
plugins: ['react', '@typescript-eslint', 'jest'],
env: {
@brygrill
brygrill / ci.yml
Created May 20, 2020 16:39
Github Actions to lint, test, and build app
name: CI
on: [push]
jobs:
build:
name: Build
runs-on: ubuntu-18.04
strategy:
matrix: