aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2019-04-01 15:25:40 +0200
committerGitHub <noreply@github.com>2019-04-01 15:25:40 +0200
commit485870946fc15c6d9b8c8e9259066cd62995cf55 (patch)
tree44ac40b1a78e4a1d4dec8b93fa87c49b190dbd0b
parent25c504c22f0a48e4a63ee3c52e06346db54de7e2 (diff)
downloadperl-software-in-gnu-guix-485870946fc15c6d9b8c8e9259066cd62995cf55.tar
perl-software-in-gnu-guix-485870946fc15c6d9b8c8e9259066cd62995cf55.tar.gz
plugin docs
-rw-r--r--README.md6
1 files changed, 2 insertions, 4 deletions
diff --git a/README.md b/README.md
index 4ba9bd1..294fac7 100644
--- a/README.md
+++ b/README.md
@@ -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();