File: es6-collections.ts

package info (click to toggle)
node-immutable 4.3.8-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,640 kB
  • sloc: javascript: 8,266; sh: 17; makefile: 6
file content (18 lines) | stat: -rw-r--r-- 494 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import {
  Map as ImmutableMap,
  Set as ImmutableSet,
} from 'immutable';

// Immutable.js collections
const mapImmutable: ImmutableMap<string, number> = ImmutableMap<string, number>();
const setImmutable: ImmutableSet<string> = ImmutableSet<string>();

// $ExpectType Map<string, number>
mapImmutable.delete('foo');

// ES6 collections
const mapES6: Map<string, number> = new Map<string, number>();
const setES6: Set<string> = new Set<string>();

// $ExpectType boolean
mapES6.delete('foo');