update docs
This commit is contained in:
parent
f4290ca8fa
commit
11fe4618ba
@ -1,3 +1,7 @@
|
|||||||
|
---
|
||||||
|
name: smartsystem
|
||||||
|
description: simplifies lazy loading with TypeScript
|
||||||
|
---
|
||||||
# smartsystem
|
# smartsystem
|
||||||
simplifies lazy loading with TypeScript
|
simplifies lazy loading with TypeScript
|
||||||
|
|
||||||
@ -32,15 +36,11 @@ import * as _myPlugin from 'myPlugin'
|
|||||||
// define the lazy module
|
// define the lazy module
|
||||||
let myLazyModule = new LazyModule<typeof _myPlugin>('myPlugin', __dirname)
|
let myLazyModule = new LazyModule<typeof _myPlugin>('myPlugin', __dirname)
|
||||||
|
|
||||||
// set the loader, defaults to npm anyway, can be systemjs alternatively
|
|
||||||
myLazyModule.setLoader('npm')
|
|
||||||
|
|
||||||
// another plugin
|
// another plugin
|
||||||
import * as _anotherPlugin from 'anotherPlugin' // plugin does not get loaded here at runtime
|
import * as _anotherPlugin from 'anotherPlugin' // plugin does not get loaded here at runtime
|
||||||
|
|
||||||
// define lazy module
|
// define lazy module
|
||||||
let anotherLazyModule = new LazyModule<typeof _anotherPlugin>('anotherPlugin', __dirname)
|
let anotherLazyModule = new LazyModule<typeof _anotherPlugin>('anotherPlugin', __dirname)
|
||||||
anotherPluginLazy.setLoader('systemjs') // sets the loader to systemjs
|
|
||||||
|
|
||||||
myLazyModule.whenLoaded.then(myPlugin => {
|
myLazyModule.whenLoaded.then(myPlugin => {
|
||||||
/* do something with myPlugin.
|
/* do something with myPlugin.
|
||||||
|
Loading…
Reference in New Issue
Block a user