Skip to content

Commit e8f35e2

Browse files
committed
Use Set if WeakSet is not available
1 parent 7b5dd7c commit e8f35e2

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

src/createGridComponent.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import memoizeOne from 'memoize-one';
44
import { createElement, PureComponent } from 'react';
55
import { cancelTimeout, requestTimeout } from './timer';
66
import { getScrollbarSize } from './domHelpers';
7+
import WeakSet from './weakset';
78

89
import type { TimeoutID } from './timer';
910

src/createListComponent.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import memoizeOne from 'memoize-one';
44
import { createElement, PureComponent } from 'react';
55
import { cancelTimeout, requestTimeout } from './timer';
6+
import WeakSet from './weakset';
67

78
import type { TimeoutID } from './timer';
89

src/weakset.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// @flow
2+
3+
const WeaksetExport = typeof WeakSet === 'undefined' ? Set : WeakSet;
4+
export default WeaksetExport;

0 commit comments

Comments
 (0)