Skip to content

Commit 8870f0b

Browse files
committed
update README
1 parent 9f4daf0 commit 8870f0b

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

README.md

+1-22
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Table of contents
1717
- [Implemented types / combinators](#implemented-types--combinators)
1818
- [Recursive types](#recursive-types)
1919
- [Mutually recursive types](#mutually-recursive-types)
20-
- [Tagged unions](#tagged-unions)
2120
- [Branded types / Refinements](#branded-types--refinements)
2221
- [Exact types](#exact-types)
2322
- [Mixing required and optional props](#mixing-required-and-optional-props)
@@ -250,7 +249,7 @@ type User = {
250249
| readonly array | `ReadonlyArray<A>` | `t.readonlyArray(A)` |
251250
| type alias | `type T = { name: A }` | `t.type({ name: A })` |
252251
| tuple | `[ A, B ]` | `t.tuple([ A, B ])` |
253-
| union | `A \| B` | `t.union([ A, B ])` or `t.taggedUnion(tag, [ A, B ])` |
252+
| union | `A \| B` | `t.union([ A, B ])` |
254253
| intersection | `A & B` | `t.intersection([ A, B ])` |
255254
| keyof | `keyof M` | `t.keyof(M)` (**only supports string keys**) |
256255
| recursive types | ✘ | `t.recursion(name, definition)` |
@@ -305,26 +304,6 @@ const Bar: t.Type<Bar> = t.recursion('Bar', () =>
305304
)
306305
```
307306

308-
# Tagged unions
309-
310-
If you are encoding tagged unions, instead of the general purpose `union` combinator, you may want to use the
311-
`taggedUnion` combinator in order to get better performances
312-
313-
```ts
314-
const A = t.type({
315-
tag: t.literal('A'),
316-
foo: t.string
317-
})
318-
319-
const B = t.type({
320-
tag: t.literal('B'),
321-
bar: t.number
322-
})
323-
324-
// the actual presence of the tag is statically checked
325-
const U = t.taggedUnion('tag', [A, B])
326-
```
327-
328307
# Branded types / Refinements
329308

330309
You can brand / refine a codec (_any_ codec) using the `brand` combinator

0 commit comments

Comments
 (0)