sindresorhus / debounce

Delay function calls until a set time elapses after the last invocation
Other
798 stars 80 forks source link

Change ESM import to default import #36

Closed huntercaron closed 1 year ago

huntercaron commented 2 years ago

When using a setup that follows the ESM spec such as ESM in Node or in the browser directly, the named import in the documentation. By using a default import instead it will work as expected.

This has likely been abstracted away by "bundler magic" in webpack, but fails in these more strict environments.

Example: JSPM Sandbox for Named Import (Errors) Example: JSPM Sandbox for Default Import (Works)

sindresorhus commented 1 year ago

Fixed