4 Commits

Author SHA1 Message Date
62b91adf0e 1.0.9 2016-10-14 04:08:43 +02:00
2f6a56c857 improve README 2016-10-14 04:08:38 +02:00
988cf907a4 1.0.8 2016-10-14 03:28:18 +02:00
18d79cb403 improve README 2016-10-14 03:27:52 +02:00
2 changed files with 5 additions and 1 deletions

View File

@ -20,14 +20,18 @@ simplifies lazy loading with TypeScript
## Usage
We recommend the use of TypeScript for best Intellisense
smartsystem supports both npm and SystemJs as module loader.
```typescript
import { LazyModule } from 'smartsystem'
import * as _myPlugin from 'myPlugin' // plugin does not get loaded here at runtime
let myPluginLazy = new LazyModule<typeof _myPlugin>('myPlugin')
myPluginLazy.setLoader('npm') // sets the loader, defaults to npm anyway
import * as _anotherPlugin from 'anotherPlugin' // plugin does not get loaded here at runtime
let anotherPluginLazy = new LazyModule<typeof _anotherPlugin>('anotherPlugin')
anotherPluginLazy.setLoader('systemjs') // sets the loader to systemjs
myPluginLazy.whenLoaded.then(myPlugin => {
/* do something with myPlugin.

View File

@ -1,6 +1,6 @@
{
"name": "smartsystem",
"version": "1.0.7",
"version": "1.0.9",
"description": "simplifies lazy loading with TypeScript",
"main": "dist/index.js",
"typings": "dist/index.d.ts",