react-wildcat-ensure
A wrapper for System.import
that behaves like Webpack's require.ensure
:
- initial import calls are asynchronous
- subsequent import calls returns a synchronous cached import response
Designed for compatibility with React Router's asynchronous route loading.
Installation
jspm:
jspm install react-wildcat-ensure
npm:
npm install react-wildcat-ensure
Usage
Importing a single module:
; // Lazy loaded component { ;}
Importing a key/value hash of modules:
; // Lazy loaded index route { ;}
Importing an array of modules:
; // Lazy loaded child routes { ;}
License
MIT