1.0.3 • Published 3 years ago

with-api v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

with-api

Made with create-react-library

NPM JavaScript Style Guide

Install

npm install --save with-api

Usage

import React from 'react'
import axios from 'axios'
import { WithApi } from 'with-api'

const getFake = () => axios.get('https://jsonplaceholder.typicode.com/todos/1');

const App = () => {
    const [{ data, error, status, isLoading, reset }, fetchSomething] = WithApi(
        getFake
    )

    React.useEffect(() => {
        fetchSomething()
    }, [])
}

export default App

License

MIT © 1997roylee

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0-a

3 years ago

1.0.0

3 years ago