Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9237d48

Browse files
morsecodistkozlitinaelja
authored andcommitted
Make notSetValue optional for typed Records (immutable-js#1461)
* Made notSetValue optional in type definition for get from Record * Added overload
1 parent 7fbc9d4 commit 9237d48

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

type-definitions/Immutable.d.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -2452,7 +2452,8 @@ declare module Immutable {
24522452
* notSetValue will be returned if provided. Note that this scenario would
24532453
* produce an error when using Flow or TypeScript.
24542454
*/
2455-
get<K extends keyof TProps>(key: K, notSetValue: any): TProps[K];
2455+
get<K extends keyof TProps>(key: K, notSetValue?: any): TProps[K];
2456+
get<T>(key: string, notSetValue: T): T;
24562457

24572458
// Reading deep values
24582459

0 commit comments

Comments
 (0)