Skip to content

Commit b3088ad

Browse files
wisdomofgodleebyron
authored andcommitted
Update README.md (immutable-js#1150)
* Update README.md update Using TypeScript with Immutable.js v4 * Update README.md Update Using TypeScript with Immutable.js v4 * Update README.md Formatting * Update README.md Formatting
1 parent 4751f77 commit b3088ad

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

README.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ Use these Immutable collections and sequences as you would use native
8888
collections in your [Flowtype](https://flowtype.org/) or [TypeScript](http://typescriptlang.org) programs while still taking
8989
advantage of type generics, error detection, and auto-complete in your IDE.
9090

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!
9393

9494
#### Using TypeScript with Immutable.js v4
9595

@@ -99,6 +99,14 @@ lib. Include either `"target": "es2015"` or `"lib": "es2015"` in your
9999
`tsconfig.json`, or provide `--target es2015` or `--lib es2015` to the
100100
`tsc` command.
101101

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+
102110
#### Using TypeScript with Immutable.js v3 and earlier:
103111

104112
Previous versions of Immutable.js include a reference file which you can include

0 commit comments

Comments
 (0)