Skip to content

Commit

Permalink
[docs]: Documentation for $Exact<T>
Browse files Browse the repository at this point in the history
  • Loading branch information
STRML committed Dec 8, 2016
1 parent 1c4595c commit 5b52264
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions website/docs/ref/utility-types.doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,3 +231,14 @@ class DataStore {
this.data.isOffline = 'SomeStore'; // oops, wrong key!
}
}

/*
## `$Exact<T>`
`$Exact<{name: string}>` is a synonym for `{| name: string |}` as in the [Object documentation](objects.html#exact-object-types).
*/

type ExactUser = $Exact<{name: string}>;
type ExactUserShorthand = {| name: string |};

const user2: ExactUser = {name: 'John Wilkes Booth'};
(user2: ExactUserShorthand);

0 comments on commit 5b52264

Please sign in to comment.