forked from immerjs/immer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make explicit use of TypeScript's ReadonlySet and ReadonlyMap types. F…
…ixes immerjs#494. TypeScript provides the ReadonlySet and ReadonlyMap types which match their normal counterparts but without any methods that mutate their data. This change makes Immutable<Map> and Immutable<Set> map to those types directly. Worth noting that Map extends ReadonlyMap so we only need to check for one to know what the resulting type is, the same goes for Set and ReadonlySet. This also removes the intermediate Set/Map types since TypeScript no longer seems to need those (likely since TypeScript 3.7, see immerjs#448).
- Loading branch information
Showing
3 changed files
with
68 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters