File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -88,8 +88,8 @@ Use these Immutable collections and sequences as you would use native
88
88
collections in your [ Flowtype] ( https://flowtype.org/ ) or [ TypeScript] ( http://typescriptlang.org ) programs while still taking
89
89
advantage of type generics, error detection, and auto-complete in your IDE.
90
90
91
- Installing ` immutable ` via npm brings with it type definitions for Flow and
92
- TypeScript, so you shouldn't need to do anything at all!
91
+ Installing ` immutable ` via npm brings with it type definitions for Flow (v0.39.0 or higher)
92
+ and TypeScript (v2.1.0 or higher) , so you shouldn't need to do anything at all!
93
93
94
94
#### Using TypeScript with Immutable.js v4
95
95
@@ -99,6 +99,14 @@ lib. Include either `"target": "es2015"` or `"lib": "es2015"` in your
99
99
` tsconfig.json ` , or provide ` --target es2015 ` or ` --lib es2015 ` to the
100
100
` tsc ` command.
101
101
102
+ ``` js
103
+ import { Map } from " immutable" ;
104
+ const map1 = Map ({ a: 1 , b: 2 , c: 3 });
105
+ const map2 = map1 .set (' b' , 50 );
106
+ map1 .get (' b' ); // 2
107
+ map2 .get (' b' ); // 50
108
+ ```
109
+
102
110
#### Using TypeScript with Immutable.js v3 and earlier:
103
111
104
112
Previous versions of Immutable.js include a reference file which you can include
You can’t perform that action at this time.
0 commit comments