Skip to content

Commit

Permalink
plugin docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel authored Apr 1, 2019
1 parent 25c504c commit 4858709
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1212,11 +1212,9 @@ Plugins should be registered with reveal.js by calling `Reveal.registerPlugin( '
When reveal.js is booted up via `Reveal.initialize()`, it will go through all registered plugins and invoke their "init" methods. If the "init" method returns a Promise, reveal.js will wait for that promise to be fullfilled before finshing the startup sequence and firing the [ready](#ready-event) event. Here's an example of a plugin that returns a promise:
```
```javascript
Reveal.registerPlugin( 'myPlugin', {
init: () => {
return new Promise( resolve => setTimeout( resolve, 3000 ) );
}
init: () => new Promise( resolve => setTimeout( resolve, 3000 ) )
} );
Reveal.addEventListener( 'ready', () => console.log( 'Three seconds later...' ) );
Reveal.initialize();
Expand Down

0 comments on commit 4858709

Please sign in to comment.