Skip to content

Instantly share code, notes, and snippets.

const Spinner = ({
children,
containerProps,
spinnerProps,
xs,
sm,
center,
}) => (
<div
className={cx('spinner-container', {
.flex-center {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
import axios from 'axios'
const getFrogs = async (params) => {
try {
const response = await axios.get(
'https://frogs-and-their-tongues.com',
params,
)
const frogs = response.data.result
return frogs
import axios from 'axios'
const getFrogs = async (params) => {
try {
const response = await axios.get(
'https://frogs-and-their-tongues.com',
params,
)
const frogs = response.data.result
return frogs
} catch (error) {
import axios from 'axios'
const getFrogs = async (params) => {
try {
const frogs = await axios.get('https://frogs-and-their-tongues.com', params)
return data
} catch (error) {
throw error
}
}
import React from 'react'
import { GoCheck, GoAlert } from 'react-icons/go'
import { FaInfoCircle } from 'react-icons/fa'
import { MdPriorityHigh } from 'react-icons/md'
import { toast } from 'react-toastify'
/*
Calling these toasts most likely happens in the UI 100% of the time.
So it is safe to render components/elements as toasts.
*/
import { toast } from 'react-toastify'
import {
info as toastInfo,
success as toastSuccess,
toastIds,
} from 'util/toast'
import App from './App'
const Root = () => {
const onOnline = () => {
import React, { isValidElement } from 'react'
import isString from 'lodash/isString'
import isFunction from 'lodash/isFunction'
import { GoCheck, GoAlert } from 'react-icons/go'
import { FaInfoCircle } from 'react-icons/fa'
import { MdPriorityHigh } from 'react-icons/md'
import { toast } from 'react-toastify'
/*
Calling these toasts most likely happens in the UI 100% of the time.
const preparePeopleWithFavoriteColor = (color) => {
const _people = []
return {
getPeople() {
return _people
},
addPeople(people) {
_people.push(...people)
},
const appReducer = combineReducers({
app,
form: formReducer,
})
// Higher order reducer that resets the redux state when we dispatch a logout action
const rootReducer = (state, action) => {
if (['LOGOUT'].includes(action.type)) {
state = undefined
}