io-ts-decode
v1.1.0
Published
Decode with error to reduce boilerplate
Downloads
15
Readme
Decode with error to reduce boilerplate
import ioTsDecode from 'io-ts-decode'
import * as t from 'io-ts'
import { pipe } from 'fp-ts/lib/pipeable'
const onLeft = (e: Error): string => String(e)
const onRight = (s: string) => `No errors: ${s}`
pipe(
ioTsDecode(t.string, null),
... // compose with other `TaskEither`s
)