Skip to content

Commit

Permalink
Update Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Elias Mulhall committed Feb 20, 2018
1 parent f70f00c commit a710f83
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions docs/classes/_decoder_.decoder.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,15 +386,19 @@ Note that `constant('string to match')` returns a `Decoder<string>` which fails

Providing the type parameter is only necessary for type-literal strings and numbers, as detailed by this table:

| Decoder | Type |
| ---------------------------- | ----------------- |
| constant(true) | Decoder<true> |
| constant(false) | Decoder<false> |
| constant(null) | Decoder<null> |
| constant('alaska') | Decoder<string> |
| constant<'alaska'>('alaska') | Decoder<'alaska'> |
| constant(50) | Decoder<number> |
| constant<50>(50) | Decoder<50> |
| Decoder | Type |
| ---------------------------- | ---------------------|
| constant(true) | Decoder<true> |
| constant(false) | Decoder<false> |
| constant(null) | Decoder<null> |
| constant('alaska') | Decoder<string> |
| constant<'alaska'>('alaska') | Decoder<'alaska'> |
| constant(50) | Decoder<number> |
| constant<50>(50) | Decoder<50> |
| constant([1,2,3]) | Decoder<number[]> |
| constant<[1,2,3]>([1,2,3]) | Decoder<[1,2,3]> |
| constant({x: 't'}) | Decoder<{x: string}> |
| constant<{x: 't'}>({x: 't'}) | Decoder<{x: 't'}> |

One place where this happens is when a type-literal is in an interface:

Expand Down

0 comments on commit a710f83

Please sign in to comment.