Hyperload
A higher-order app and component for dynamic import of Hyperapp v2 components. Requires support (or polyfill) for dynamic imports.
Installation
Node.js
Install with npm / Yarn.
npm i hyperload
Then with a module bundler like rollup or webpack, use as you would anything else.
;
Or using require.
const withHyperload Hyperload = ;
Browser
Download the minified library from the CDN.
You can find the library in window.hyperload
.
Example
;; const Loading = <span>error ? `Error! ` : `loading ...`</span>; const LoadMyComponent = ; <LoadMyComponent /> container: documentbody;
Both the loading
component and the dynamically imported module will receive the props that you pass to the Hyperload
component. Errors encountered while importing your module will be passed to your loading
component as the error
prop.
License
Hyperload is MIT licensed. See LICENSE.