Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Mar 22, 2025. It is now read-only.

tetsuo/axios-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

axios-ts

axios for fp-ts.

Originally extracted from elm-ts.

Usage

It works with io-ts types.

For example, you can get a list of most recent posts from my blog:

import * as t from 'io-ts'
import * as E from 'fp-ts/lib/Either'
import { toTaskEither } from '@tetsuo/axios-ts/lib/TaskEither'
import { get } from '@tetsuo/axios-ts/lib/Client'
import { expected } from '@tetsuo/axios-ts/lib/Expected'

const Entry = t.type({
  title: t.string,
  description: t.string,
  slug: t.string,
})

const Response = t.type({
  entries: t.array(Entry),
})

const program = toTaskEither(get('https://ogu.nz/index.json', expected(Response)))

program().then(E.bimap(console.error, console.log))

About

axios for fp-ts

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •