@koax/fetch-json

0.1.1 • Public • Published

fetch-json

Build status Git tag NPM version Code style

Fetch json sugar.

Installation

$ npm install @koax/fetch-json

Usage

import koax from 'koax'
import {fetchEffect} from '@koax/fetch'
import {post} from '@koax/fetch-json'

let app = koax()

app.use(fetchEffect)

app(post('https://slack.com/api/chat.postMessage', {
  token: 'secret',
  channel: 'C1234567890',
  text: 'Hello world'
})).then(res => res.body) // {ok: true ...}

API

get(url, params)

  • url - url string
  • params - parameters to put in body (should we put in url for get?)

Returns: FETCH action

post(url, params)

  • url - url string
  • params - parameters to put in body

Returns: FETCH action

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @koax/fetch-json

Weekly Downloads

0

Version

0.1.1

License

MIT

Last publish

Collaborators

  • koax