Skip to content

Commit 461e998

Browse files
committed
version bump and fixed missed build
1 parent 4502275 commit 461e998

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

dist/react-rotating-text.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ var ReactRotatingText = (function (_React$Component) {
5252
// save the timeouts so we can stop on unmount
5353
var timeout = setTimeout(loopingFunc, pause);
5454
this.timeouts.push(timeout);
55+
56+
// prevent memory leak
57+
var maxTimeouts = 100;
58+
if (this.timeouts.length > maxTimeouts) {
59+
clearTimeout(this.timeouts[0]);
60+
this.timeouts.shift();
61+
}
5562
}
5663
}, {
5764
key: '_type',

dist/react-rotating-text.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/ReactRotatingText.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ var ReactRotatingText = (function (_React$Component) {
5050
// save the timeouts so we can stop on unmount
5151
var timeout = setTimeout(loopingFunc, pause);
5252
this.timeouts.push(timeout);
53+
54+
// prevent memory leak
55+
var maxTimeouts = 100;
56+
if (this.timeouts.length > maxTimeouts) {
57+
clearTimeout(this.timeouts[0]);
58+
this.timeouts.shift();
59+
}
5360
}
5461
}, {
5562
key: '_type',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-rotating-text",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"description": "A simple react component to display an array of words/sentences with a typewriter effect.",
55
"main": "lib/ReactRotatingText.js",
66
"author": "Adrian Li",

0 commit comments

Comments
 (0)