Skip to content

Commit

Permalink
Provide default type to first() and last() (#1676)
Browse files Browse the repository at this point in the history
  • Loading branch information
johanblumenberg authored and leebyron committed Jan 17, 2020
1 parent 751082f commit 91c7c1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions type-definitions/Immutable.d.ts
Expand Up @@ -3878,15 +3878,15 @@ declare module Immutable {
* In case the `Collection` is empty returns the optional default
* value if provided, if no default value is provided returns undefined.
*/
first<NSV>(notSetValue?: NSV): V | NSV;
first<NSV = undefined>(notSetValue?: NSV): V | NSV;

/**
* In case the `Collection` is not empty returns the last element of the
* `Collection`.
* In case the `Collection` is empty returns the optional default
* value if provided, if no default value is provided returns undefined.
*/
last<NSV>(notSetValue?: NSV): V | NSV;
last<NSV = undefined>(notSetValue?: NSV): V | NSV;

// Reading deep values

Expand Down

3 comments on commit 91c7c1e

@yasinkocak
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need this changes. When will there a new release?

@codelovesme
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yasinkocak
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not working with yarn workspace when i add yarn add <git remote url>#<commit> i can't import module immutable in typescript

Please sign in to comment.