]> git.ardis.lu - sleepy-operators/commitdiff
Add examples for dynamic import
authorArdis Lu <ardisglu@gmail.com>
Wed, 22 Feb 2023 07:48:19 +0000 (23:48 -0800)
committerArdis Lu <ardisglu@gmail.com>
Wed, 22 Feb 2023 07:48:19 +0000 (23:48 -0800)
README.md

index 4813c577b4db5e17e1d003261f4070b5fcb7f3f8..62b534935f880caef2c5955b616a58076ffedb39 100644 (file)
--- a/README.md
+++ b/README.md
@@ -10,8 +10,20 @@ Import the module:
 import * as sleepy from 'https://cdn.jsdelivr.net/gh/ardislu/sleepy-operators/sleepy-operators.js';
 ```
 
-Or import individual functions:
+Import individual functions:
 
 ```javascript
 import { sort, sum } from 'https://cdn.jsdelivr.net/gh/ardislu/sleepy-operators/sleepy-operators.js';
 ```
+
+Dynamically import the module:
+
+```javascript
+const sleepy = await import('https://cdn.jsdelivr.net/gh/ardislu/sleepy-operators/sleepy-operators.js');
+```
+
+Dynamically import individual functions:
+
+```javascript
+const { sort, sum } = await import('https://cdn.jsdelivr.net/gh/ardislu/sleepy-operators/sleepy-operators.js');
+```
This page took 0.033299 seconds and 4 git commands to generate.