Skip to content

Commit 0de2e7d

Browse files
committed
types: Use BoundedDiff for Identity object type, to make it read-only
We'd prefer Identity to be read-only, and it hasn't been because of facebook/flow#6225 BoundedDiff wraps its result in $ReadOnly<…>; see there.
1 parent d543651 commit 0de2e7d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/types.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { Node } from 'react';
33
import type { IntlShape } from 'react-intl';
44
import type { DangerouslyImpreciseStyleProp } from 'react-native/Libraries/StyleSheet/StyleSheet';
55

6-
import type { SubsetProperties } from './generics';
6+
import type { BoundedDiff, SubsetProperties } from './generics';
77
import type {
88
Auth,
99
Topic,
@@ -151,7 +151,7 @@ export type Account = {|
151151
* Use `identityOfAuth` or `identityOfAccount` to make one of these where
152152
* you have an `Auth` or `Account`.
153153
*/
154-
export type Identity = $Diff<Auth, {| apiKey: string |}>;
154+
export type Identity = BoundedDiff<Auth, {| +apiKey: Auth['apiKey'] |}>;
155155

156156
export type EmojiType = 'image' | 'unicode';
157157

0 commit comments

Comments
 (0)