mirror of
https://github.com/animate-css/animate.css.git
synced 2024-11-13 07:41:08 +01:00
Update 04-javascript.md (#1209)
this arrow function uses implicit return. an explicit `return` throws an error.
This commit is contained in:
parent
13282a7176
commit
7e41ad5f0b
2 changed files with 2 additions and 2 deletions
|
@ -1114,7 +1114,7 @@ element.style.setProperty('--animate-duration', '0.5s');
|
|||
<p>You can also use a simple function to add the animations classes and remove them automatically:</p>
|
||||
<pre><code class="language-javascript">const animateCSS = (element, animation, prefix = 'animate__') =>
|
||||
// We create a Promise and return it
|
||||
return new Promise((resolve, reject) => {
|
||||
new Promise((resolve, reject) => {
|
||||
const animationName = `${prefix}${animation}`;
|
||||
const node = document.querySelector(element);
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ You can also use a simple function to add the animations classes and remove them
|
|||
```javascript
|
||||
const animateCSS = (element, animation, prefix = 'animate__') =>
|
||||
// We create a Promise and return it
|
||||
return new Promise((resolve, reject) => {
|
||||
new Promise((resolve, reject) => {
|
||||
const animationName = `${prefix}${animation}`;
|
||||
const node = document.querySelector(element);
|
||||
|
||||
|
|
Loading…
Reference in a new issue