From 472dc4c417dcf97eca5dc2d7edc0c0f59b0269c4 Mon Sep 17 00:00:00 2001 From: Marie Malarme Date: Mon, 8 Mar 2021 16:30:23 +0000 Subject: [PATCH] baby-shower: add code examples to import libraries --- subjects/baby-shower/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/subjects/baby-shower/README.md b/subjects/baby-shower/README.md index 95ca33cc1..a65e62fbb 100644 --- a/subjects/baby-shower/README.md +++ b/subjects/baby-shower/README.md @@ -10,6 +10,17 @@ The one we're going to use today is [canvas confetti][0]. From your script, [`import`][1] the package as indicated in the documentation, and launch the function to pop confetti when the page loads. Then, [add an event listener][2] on [`keydown` event][3] that triggers the same confetti popping function any time a key of the keyboard is pressed. +### Code examples + +Import code from libraries & use it: + +```js +// import and use the `hello` function from a library +import { hello } from 'hello-library-url' + +hello() +``` + ### Expected output This is what you should see in the browser: