react-typing-animation
Advanced tools
Comparing version 1.5.0 to 1.5.1
@@ -137,3 +137,3 @@ 'use strict'; | ||
if (!(_this.state.toType.length > 0 || cursor.numToErase > 0)) { | ||
_context3.next = 8; | ||
_context3.next = 10; | ||
break; | ||
@@ -143,3 +143,3 @@ } | ||
_context3.next = 4; | ||
return _this.props.onTyping(_this.state.text); | ||
return _this.props.onBeforeType(_this.state.text); | ||
@@ -151,28 +151,32 @@ case 4: | ||
case 6: | ||
_context3.next = 16; | ||
_context3.next = 8; | ||
return _this.props.onAfterType(_this.state.text); | ||
case 8: | ||
_context3.next = 18; | ||
break; | ||
case 8: | ||
_context3.next = 10; | ||
case 10: | ||
_context3.next = 12; | ||
return _this.props.onFinishedTyping(); | ||
case 10: | ||
case 12: | ||
if (!_this.props.loop) { | ||
_context3.next = 15; | ||
_context3.next = 17; | ||
break; | ||
} | ||
_context3.next = 13; | ||
_context3.next = 15; | ||
return _this.resetState(); | ||
case 13: | ||
_context3.next = 16; | ||
case 15: | ||
_context3.next = 18; | ||
break; | ||
case 15: | ||
case 17: | ||
return _context3.abrupt('return', _this.updateState({ isFinished: true })); | ||
case 16: | ||
case 18: | ||
if (!_this.hasMounted) { | ||
_context3.next = 18; | ||
_context3.next = 20; | ||
break; | ||
@@ -183,3 +187,3 @@ } | ||
case 18: | ||
case 20: | ||
case 'end': | ||
@@ -487,4 +491,5 @@ return _context3.stop(); | ||
loop: _propTypes2.default.bool, | ||
onTyping: _propTypes2.default.func, | ||
onStartedTyping: _propTypes2.default.func, | ||
onBeforeType: _propTypes2.default.func, | ||
onAfterType: _propTypes2.default.func, | ||
onFinishedTyping: _propTypes2.default.func | ||
@@ -499,4 +504,5 @@ }; | ||
loop: false, | ||
onTyping: function onTyping() {}, | ||
onStartedTyping: function onStartedTyping() {}, | ||
onBeforeType: function onBeforeType() {}, | ||
onAfterType: function onAfterType() {}, | ||
onFinishedTyping: function onFinishedTyping() {} | ||
@@ -503,0 +509,0 @@ }; |
@@ -24,3 +24,4 @@ import React, { Component } from 'react'; | ||
onStartedTyping={() => console.log('started typing')} | ||
onTyping={(text) => console.log(text)} | ||
onBeforeType={(text) => console.log('onBeforeType', text)} | ||
onAfterType={(text) => console.log('onAfterType', text)} | ||
> | ||
@@ -27,0 +28,0 @@ <h1> |
{ | ||
"name": "react-typing-animation", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"author": "Adam King https://github.com/adamjking3", | ||
@@ -5,0 +5,0 @@ "homepage": "https://adamjking3.github.io/react-typing-animation-example/", |
@@ -77,3 +77,4 @@ # React-typing-animation | ||
| onStartedTyping | function | () => {} | no | | ||
| onTyping | function | () => {} | no | | ||
| onBeforeType | function | () => {} | no | | ||
| onAfterType | function | () => {} | no | | ||
| onFinishedTyping | function | () => {} | no | | ||
@@ -80,0 +81,0 @@ |
@@ -72,4 +72,5 @@ import React, { Component } from 'react'; | ||
if (this.state.toType.length > 0 || cursor.numToErase > 0) { | ||
await this.props.onTyping(this.state.text); | ||
await this.props.onBeforeType(this.state.text); | ||
await this.type(); | ||
await this.props.onAfterType(this.state.text); | ||
} else { | ||
@@ -216,4 +217,5 @@ await this.props.onFinishedTyping(); | ||
loop: PropTypes.bool, | ||
onTyping: PropTypes.func, | ||
onStartedTyping: PropTypes.func, | ||
onBeforeType: PropTypes.func, | ||
onAfterType: PropTypes.func, | ||
onFinishedTyping: PropTypes.func, | ||
@@ -228,4 +230,5 @@ }; | ||
loop: false, | ||
onTyping: () => {}, | ||
onStartedTyping: () => {}, | ||
onBeforeType: () => {}, | ||
onAfterType: () => {}, | ||
onFinishedTyping: () => {}, | ||
@@ -232,0 +235,0 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5846056
1411
170