Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 455 Bytes

README.md

File metadata and controls

30 lines (22 loc) · 455 Bytes

fetcher.js

Installation

<script src='https://cdn.jsdelivr.net/gh/lullaby6/fetcher.js/cdn.js'></script>       

Usage

const todosFetcher = fetcher({
    url: 'https://jsonplaceholder.typicode.com/todos',
    type: 'json',
})

const todoOne = await todosFetcher.get({
    query: 1
})

console.log(todoOne);

const first10Todos = await todosFetcher.get({
    params: {
        _limit: 10
    }
})

console.log(first10Todos);