This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POSTGRES_USER=phelps | |
POSTGRES_PASS=phelps | |
POSTGRES_HOST=localhost |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: benphelps/docker-ruby-phantomjs:latest | |
Testing: | |
services: | |
- postgres:latest | |
variables: | |
POSTGRES_DB: test | |
POSTGRES_HOST: postgres | |
POSTGRES_USER: testuser | |
POSTGRES_PASS: testuser | |
environment: test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect, useCallback } from 'react' | |
export const IDLE = 'IDLE' | |
export const LOADING = 'LOADING' | |
export const SUCCESS = 'SUCCESS' | |
export const ERROR = 'ERROR' | |
export function useAsyncData(fetchFn, deps) { | |
const stableFetchFn = useCallback(fetchFn, deps) | |
const [{ state, data, error }, setState] = useState({ state: IDLE }) |
OlderNewer