From 7f69db1ce36742b65e36abd0b71b2778ec157db7 Mon Sep 17 00:00:00 2001 From: Alexander Marks Date: Fri, 26 Jul 2019 14:05:37 -0700 Subject: [PATCH] Update README to explain new ES module usage --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 8ae4405..fa31a03 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,16 @@ npm install --save blocking-elements ``` +### ES Module + +You can also use this polyfill from an ES module by importing `blockingElements` from `/dist/blocking-elements.js`, or if your toolchain suports bare module specifiers (e.g. TypeScript with `--moduleResolution=node`), from the `blocking-elements` module name. Note that this file is not minified, includes ES2015 classes, and does not set the `document.$blockingElements` global. + +```js +import {blockingElements} from 'blocking-elements'; +blockingElements.push(...); +blockingElements.remove(...); +``` + ## Local development Install the dependencies with `npm install` and serve the resources.